03856me
Active Member
- Joined
- Apr 4, 2008
- Messages
- 297
Goal: Loop through rows on a specific worksheet (Sheet1) and copy values in specific columns to another worksheet to specific sheets.
Progress: This code works perfectly when looping through all the worksheets.
Question: How do I loop through rows and not worksheets?
Help please, I am having no luck finding what I want, any help if appreciated so much.
Progress: This code works perfectly when looping through all the worksheets.
Question: How do I loop through rows and not worksheets?
Help please, I am having no luck finding what I want, any help if appreciated so much.
VBA Code:
Sub CreateTest()
Dim wb As Workbook
Set wb = ThisWorkbook
Dim ws As Worksheet
Set ws = wb.Sheets("test")
For Each ws In Worksheets
If ws.Name <> "Upload" And ws.Name <> "test" Then
Range("D999").End(xlUp).Offset(1, 0).Value = ws.Range("B").Value 'New column location column B
Range("E999").End(xlUp).Offset(1, 0).Value = ws.Range("F15").Value 'New column location column C
Range("F999").End(xlUp).Offset(1, 0).Value = ws.Range("G44").Value 'New column location column E
Range("L999").End(xlUp).Offset(1, 0).Value = ws.Range("I39").Value 'New column location column F
Range("M999").End(xlUp).Offset(1, 0).Value = ws.Range("G39").Value 'New column location column J
End Sub