Peteypirate
New Member
- Joined
- Mar 27, 2015
- Messages
- 6
Hopefully someone can help me with this! Have a very limited knowledge of VBA, but I'm pretty sure what I want to do can be achieved with the right knowhow!
I have the following string of code;
Range("A4:BH4961").Select
Selection.ClearContents
Range("A4").Select
Sheets("Roadside Assistance").Select
ActiveSheet.Range("$C$4970:$BJ$9927").AutoFilter Field:=1, Criteria1:="<>"
Range("C4970:C9928").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Summary").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Roadside Assistance").Select
Application.CutCopyMode = False
ActiveSheet.ShowAllData
Sheets("Summary").Select
Range("A3").Select
End Sub
The section in red is what I want to loop. Each time the code loops, I'd like it to move the bits I have posted in bold by 1. so Autofilter field becomes 2, range c4970:C9928 becomes D4970:D9928 and A3 becomes B3.
I'd like it to run this 60 times and then stop.
I'm hoping this is possible and any help would be much appreciated!
I have the following string of code;
Range("A4:BH4961").Select
Selection.ClearContents
Range("A4").Select
Sheets("Roadside Assistance").Select
ActiveSheet.Range("$C$4970:$BJ$9927").AutoFilter Field:=1, Criteria1:="<>"
Range("C4970:C9928").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Summary").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Roadside Assistance").Select
Application.CutCopyMode = False
ActiveSheet.ShowAllData
Sheets("Summary").Select
Range("A3").Select
End Sub
The section in red is what I want to loop. Each time the code loops, I'd like it to move the bits I have posted in bold by 1. so Autofilter field becomes 2, range c4970:C9928 becomes D4970:D9928 and A3 becomes B3.
I'd like it to run this 60 times and then stop.
I'm hoping this is possible and any help would be much appreciated!