Hello,
Getting above error when running the below Macro, and cannot figure out why for life of me. I have searched endlessly, but am new to VBA so hoping someone can assist.
I understand the code I've used is problematic due to the use of .select and copying/paste back and forth b/n sheets, however, the code was working fine yesterday and now I am getting the runtime error one the second line of copy/past code I've highlighted and bolded in red. I get the error no matter if "sheet1" is visible or hidden to start the code.
My goal is to copy multiple ranges from one sheet ("sheet1") and past those ranges to another sheet("Rent Roll"), just in different columns/rows. I know there is a much easier and cleaner way to do this I just haven't been able to figure it out. Any help in either fixing this issue to get this code working or simplying is very much appreciated.
Getting above error when running the below Macro, and cannot figure out why for life of me. I have searched endlessly, but am new to VBA so hoping someone can assist.
I understand the code I've used is problematic due to the use of .select and copying/paste back and forth b/n sheets, however, the code was working fine yesterday and now I am getting the runtime error one the second line of copy/past code I've highlighted and bolded in red. I get the error no matter if "sheet1" is visible or hidden to start the code.
My goal is to copy multiple ranges from one sheet ("sheet1") and past those ranges to another sheet("Rent Roll"), just in different columns/rows. I know there is a much easier and cleaner way to do this I just haven't been able to figure it out. Any help in either fixing this issue to get this code working or simplying is very much appreciated.
Code:
Sub UpdateRR()
' Copy from hidden RR to main RR
Worksheets("Sheet1").Visible = True
Application.ScreenUpdating = False
Sheets("Sheet1").Select
Range("A2:A31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("E6").Select
ActiveSheet.Paste
[B][COLOR=#ff0000] Sheets("Sheet1").Select[/COLOR][/B]
Range("B2:B31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("D6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("C2:C31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("G6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("D2:D31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("h6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("e2:e31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("f6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("f2:f31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("j6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("g2:g31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("m6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("h2:h31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("r6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("i2:i31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("t6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("j2:j31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("u6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("k2:k31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("x6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("l2:l31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("y6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("m2:m31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("aa6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("n2:n31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("ab6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("o2:o31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("ae6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("p2:p31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("ag6").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("q2:q31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rent Roll").Select
Range("af6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Worksheets("Sheet1").Visible = False
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: