khaos
09-27-2010, 10:22 PM
Hello everyone.
I am copy/pasting data between worksheets & I'm running into the issue of blank rows when I transpose the data. I can use the Macro recorder to show the Autofill, but I want to do this dynamically. This is a sample of what I have so far:
Sub AutofillPaste()
' AutoFill Data in Blank Rows
Selection.Copy
Range("A2,A3,A4").Select
Range("A4").Activate
ActiveSheet.Paste
Range("A5").Select
Application.CutCopyMode = False
Selection.Copy
Range("A5,A6,A7,A8").Select
Range("A8").Activate
ActiveSheet.Paste
End Sub
Basically this code copies the cell value & pastes it into the next couple of blank cells under it manually. I want to do this dynamically to copy a value & paste it in the next blank cell until it reaches a different cell value, then have it copy the 2nd cell value & paste it into the blank cells in that particular column.
Can someone please help me make this dynamic?
Thanks.
I am copy/pasting data between worksheets & I'm running into the issue of blank rows when I transpose the data. I can use the Macro recorder to show the Autofill, but I want to do this dynamically. This is a sample of what I have so far:
Sub AutofillPaste()
' AutoFill Data in Blank Rows
Selection.Copy
Range("A2,A3,A4").Select
Range("A4").Activate
ActiveSheet.Paste
Range("A5").Select
Application.CutCopyMode = False
Selection.Copy
Range("A5,A6,A7,A8").Select
Range("A8").Activate
ActiveSheet.Paste
End Sub
Basically this code copies the cell value & pastes it into the next couple of blank cells under it manually. I want to do this dynamically to copy a value & paste it in the next blank cell until it reaches a different cell value, then have it copy the 2nd cell value & paste it into the blank cells in that particular column.
Can someone please help me make this dynamic?
Thanks.