Hi all,
I'm having problem writing a VB macro for excel.
Currently I have:
x = 5
Do While Cells(x, 5) = "New Trade"
Cells(x, 1).Select
Selection.Copy
Cells(x, 12).Select
ActiveCell.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
x = x + 1
Loop
-----------------------------
I need to copy cells(x,1:4) where x,5 = New trade and paste it to cell (x,12) where x starts from row 5. The next record which meet the condition will then paste to cell (6,12) etc. My data has many records where x,5 is <>"New trade", then followed by the last few records which meets the condition of "New trade". Is my condition in the loop correct? and how do I copy a range of moving cells?
Thanks so much for all the help I can get on this
Cheers
I'm having problem writing a VB macro for excel.
Currently I have:
x = 5
Do While Cells(x, 5) = "New Trade"
Cells(x, 1).Select
Selection.Copy
Cells(x, 12).Select
ActiveCell.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
x = x + 1
Loop
-----------------------------
I need to copy cells(x,1:4) where x,5 = New trade and paste it to cell (x,12) where x starts from row 5. The next record which meet the condition will then paste to cell (6,12) etc. My data has many records where x,5 is <>"New trade", then followed by the last few records which meets the condition of "New trade". Is my condition in the loop correct? and how do I copy a range of moving cells?
Thanks so much for all the help I can get on this