Hi everyone
I'm trying to get this to work but I just don't have a lot of experience with VBA.
What I'm trying to do is to get data from "sheet3", columns 1, 2 and 5 and paste them on the "summary" sheet starting at row A7.
The workbook that I'm working with has 37 sheets, 35 of those sheets contains data in columns 1, 2 & 5 (in all sheets) that I'd like to display on the "summary" sheet. the summary sheet is divided into to "charts"; the first is from A7 to D13 and the second is from A22 to D49. if anyone could help with fixing the below code, that would be great. Also, if anyone has a better way of doing it I'd really appreciate it. I was going to copy/paste the code 30+x and simply change the sheet name etc.
I'm trying to get this to work but I just don't have a lot of experience with VBA.
What I'm trying to do is to get data from "sheet3", columns 1, 2 and 5 and paste them on the "summary" sheet starting at row A7.
The workbook that I'm working with has 37 sheets, 35 of those sheets contains data in columns 1, 2 & 5 (in all sheets) that I'd like to display on the "summary" sheet. the summary sheet is divided into to "charts"; the first is from A7 to D13 and the second is from A22 to D49. if anyone could help with fixing the below code, that would be great. Also, if anyone has a better way of doing it I'd really appreciate it. I was going to copy/paste the code 30+x and simply change the sheet name etc.
HTML:
Application.ScreenUpdating = 0
'With Worksheets("1235 Law 11-8a")
With Sheet3 'using index,shorter neam
' Find last row of data
lr = .Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
x = 7
For i = 2 To lr
If Range("A" & i) <> "" Then
.Range(.Cells(i, 1), .Cells(i, 2), .Cells(i, 5)).Copy
With Worksheets("SUMMARY")
.Cells(x, 1).PasteSpecial xlPasteFormulasAndNumberFormats
End With
End If
Next i
End With
With Application
.CutCopyMode = False
.ScreenUpdating = 1
End With
End Sub