New to the forum, and new to using macros in excel. I have a pretty basic C&P need, but am not sure how to set the range so that it's "dynamic," as opposed to it being stuck at the specific cells used when I recorded the macro. Basically, imagine three columns in an excel sheet. From outside excel I need to copy three rows of data, but want to transpose those three rows into three columns of a single row in excel. I recorded the following macro:
Sub AdPaste()
'
' AdPaste Macro
'
' Keyboard Shortcut: Ctrl+e
'
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
Selection.Copy
Range("C53").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("C54:C56").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("C55").Select
End Sub
This worked great for the first row used when recording the macro, but when I tried it for the subsequent entry in the following row, obviously it pasted the new data in the previous row. So, what do I need to do to adjust the macro so that the function takes place relative to the cell I have selected. Basically, I have 100 rows of data to paste in per excel file, and I need to go row by row transposing three rows of data into three columns in a single row, row after row.
Thanks for the help, I really appreciate it.
Bookmarks