Hoping you may be able to help. Being a newbie, this one has me stumped...
Trying to start from cell a1, and copy the range of data from b1 to i1 to position k1. I need this to be loopped so the same is done for all lines of data from a1, a3, a5, a6 etc until cell ax is blank. Having red quote a few articles and playing around with their suggestion, the code below represents my work thus far, and is also the source of my frustration.
You will note that I am trying to use formulas to perform the copy / paste within the range codes, and I assume this is where the problem lay.
Excel is saying that line 9 is causing the problem. Is anyone able to explain the correct syntax?
Thanks
GV
Trying to start from cell a1, and copy the range of data from b1 to i1 to position k1. I need this to be loopped so the same is done for all lines of data from a1, a3, a5, a6 etc until cell ax is blank. Having red quote a few articles and playing around with their suggestion, the code below represents my work thus far, and is also the source of my frustration.
You will note that I am trying to use formulas to perform the copy / paste within the range codes, and I assume this is where the problem lay.
Excel is saying that line 9 is causing the problem. Is anyone able to explain the correct syntax?
Thanks
GV
Code:
Sub CutPaste()
Dim TopLeft As Range ' Not sure if this is valid as I need the cell reference.
Dim TopRight As Range
Dim DestLeft As Range
Do While ActiveCell.Select <> Empty
Set TopLeft = ActiveCell.Offset(0, 1) ' Brings back the contents of the cell , not the cell reference (need the cell reference)
Set TopRight = ActiveCell.Offset(0, 8) ' As above
Set DestLeft = ActiveCell.Offset(0, 10) ' As above
Range("TopLeft : TopRight").Select ' This is where excel has a problem
Selection.Copy
Range("DestLeft").Select
ActiveSheet.Paste
ActiveCell.Offset(2, 0).Select
Loop
End Sub