DemolitionMech
New Member
- Joined
- Feb 17, 2020
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hello,
New to VBA. I am currently having trouble going through column names in order, and copy and pasting them to a location. Basically, I have data in cells F1:F7 , G1:G7, H1:H7 , etc. and I would like to paste those values one at a time underneath each other in column A (moving to the right).
I have gotten this to work with this formula -
Sub CopyDown()
Dim c As Long
Do
c = c + 1
Range("F1:F7").Copy Range("A" & Rows.Count).End(xlUp)(2)
Range("G1:G7").Copy Range("A" & Rows.Count).End(xlUp)(2)
Range("H1:H7").Copy Range("A" & Rows.Count).End(xlUp)(2)
Loop Until c = 1
End Sub
However, the problem is that I have over 130 columns of data. So I am not trying to write out - Range("K1:K7").Copy Range("A" & Rows.Count).End(xlUp)(2) - over and over 130 times.
I was wondering how I would loop this properly and still accomplish my goal.
Any help is much appreciated, thank you!
-Matt
New to VBA. I am currently having trouble going through column names in order, and copy and pasting them to a location. Basically, I have data in cells F1:F7 , G1:G7, H1:H7 , etc. and I would like to paste those values one at a time underneath each other in column A (moving to the right).
I have gotten this to work with this formula -
Sub CopyDown()
Dim c As Long
Do
c = c + 1
Range("F1:F7").Copy Range("A" & Rows.Count).End(xlUp)(2)
Range("G1:G7").Copy Range("A" & Rows.Count).End(xlUp)(2)
Range("H1:H7").Copy Range("A" & Rows.Count).End(xlUp)(2)
Loop Until c = 1
End Sub
However, the problem is that I have over 130 columns of data. So I am not trying to write out - Range("K1:K7").Copy Range("A" & Rows.Count).End(xlUp)(2) - over and over 130 times.
I was wondering how I would loop this properly and still accomplish my goal.
Any help is much appreciated, thank you!
-Matt