Reputation: 1
I am a complete beginner to excel VBA, and I have been consistently creating a report for work which consists of excel spreadsheet columns downloaded from salesforce. The Columns are (A) through (T) and Column (T) contains comments for each of the projects in that same row.
I have been inserting a new row beneath each project and dragging Column cell (T1) into that row, then merging and centering that row.
then I repeat the process for Row 3 (Originally Row 2) and take Column cell (T3) and insert a new Row below the Row 3 project and Drag (T3) below then merge and center that row.
this process repeats. ( I have only done this once for someone else manually before realizing it is ridiculous to do manually) I am quite stuck with writing a macro for this.
I know I need to:
End Sub
I know what I need to do. But I cannot think of the correct code to get me where I need to go.
Can anyone help with this?
Added below is the written code of what I have so far.
Aright here is what I have so far.It breaks and just continues merging that same row over and over (endless loop). I am guessing it has to do with ActiveSheet.Paste. Any Ideas for me?
Sub Addingrowsv1
Do Until ActiveCell.Value = ""
Rows("3:3").Select
Range("C3").Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("T2").Select Selection.Copy
Range("C3").Select
ActiveSheet.Paste
Range("C3:S3").Merge
Loop
End Sub
Thank you, Jim
Upvotes: 0
Views: 466
Reputation: 1
VBA is quite good at manipulating data; so what you want to do is well within VBA scope.
First, start by turning on the macro recorder and do one of your pairs of lines. They go look at the recorded code.
Generally, you will then take the recorded code and customize it to go inside a loop.
Do you need help in doing a recording?
Upvotes: 0