Hi! Hoping this is a simple question to have answered. New enough to using Excel at this level that I'm stumped on my own. What I want to do is automate the process of copying three rows of data from outside excel, then paste and match destination formatting into excel, then transpose those three rows into the three empty columns of a row, as seen in the attached screenshot, and then do that with new data into each row of the worksheet:
I recorded a macro of the process, but the problem is that it's stuck with the ranges used when recording the macro, and I have no idea how to adapt it so that I can paste and transpose new data into each row. Basically, I want to be able to select cell C3 to get that data into row 2, then select C4 to get the next data into row 3, etc etc. Here is the macro I recorded, trying to achieve this purpose:
That macro records me selecting the equivalent of cell C3, clicking the Paste and Match Destination Formatting ribbon shortcut, selecting cell C2, clicking the Paste and Transpose ribbon shortcut, then selecting cells C3:5 and deleting the three pasted in rows, and finally selecting cell C4, to start with the next set of data to be pasted in. But I'm hoping there's an easy way to adapt the macro so that it's not limited to the range I used when recording the macro, but instead is actually functional to paste and transpose row after row of unique data into the correct columns.
Thanks so much for the help, and please let me know if I can provide any clarification.
I recorded a macro of the process, but the problem is that it's stuck with the ranges used when recording the macro, and I have no idea how to adapt it so that I can paste and transpose new data into each row. Basically, I want to be able to select cell C3 to get that data into row 2, then select C4 to get the next data into row 3, etc etc. Here is the macro I recorded, trying to achieve this purpose:
VBA Code:
Sub ADCP()
'
' ADCP Macro
'
' Keyboard Shortcut: Ctrl+l
'
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
Selection.Copy
Range("B107").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("B108:B110").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("B109").Select
End Sub
That macro records me selecting the equivalent of cell C3, clicking the Paste and Match Destination Formatting ribbon shortcut, selecting cell C2, clicking the Paste and Transpose ribbon shortcut, then selecting cells C3:5 and deleting the three pasted in rows, and finally selecting cell C4, to start with the next set of data to be pasted in. But I'm hoping there's an easy way to adapt the macro so that it's not limited to the range I used when recording the macro, but instead is actually functional to paste and transpose row after row of unique data into the correct columns.
Thanks so much for the help, and please let me know if I can provide any clarification.