I have a 12 sheets with information within them. Certain information I want to collate from each sheet onto one sheet.
So,
I first of all find out how many rows I am dealing with, then I want to copy the first two columns into another sheet (Results).
Now I can get the first column to copy across from each sheet but a cannot workout what im doing wrong to get the second column copied aswell.
Sub loopMe()
Dim Jan As Worksheet, Feb As Worksheet, Mar As Worksheet, Apr As Worksheet, May As Worksheet, Jun As Worksheet
Dim Jul As Worksheet, Aug As Worksheet, Sep As Worksheet, October As Worksheet, Nov As Worksheet, Dec As Worksheet
Dim LstR As Long, rngJan As Range, c As Range, rngFeb As Range, rngMar As Range, rngApr As Range
Dim rngMay As Range, rngJun As Range, rngJul As Range, rngAug As Range, rngSep As Range, rngOctober As Range
Dim rngNov As Range, rngDec As Range
Set Jan = Sheets("January") 'set the sheet to loop
With Jan 'do something with the sheet
LstR = .Cells(.Rows.Count, "A").End(xlUp).Row 'find last row
Set rngJan = .Range("A2:B" & LstR) 'set range to loop
End With
Set Feb = Sheets("February") 'set the sheet to paste
With Feb 'do something with the sheet
LstR = .Cells(.Rows.Count, "A").End(xlUp).Row 'find last row
Set rngFeb = .Range("A2:B" & LstR) 'set range to loop
End With
' The above should set the range of data in each sheet (I hope) ' Then I run the following
For Each y In rngJan
Worksheets("Results").Range("A65536").End(xlUp).Offset(1, 0).Value = y.Value
Next y
For Each y In rngFeb
Worksheets("Results").Range("A65536").End(xlUp).Offset(1, 0).Value = y.Value
Next y
The information I need are stored in columns A & B so they are what im trying to copy across.
Can anyone help??