I have some code to copy a range from one sheet to another... this working code is in a userform...
I copied this code to the sheet and used a button to call it, but I now get a 400 error.
Here's the working code from the userform;
Code
Private Sub CommandButton5_Click()
'Refresh item number columns
Unload UserForm1
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("N").Activate
Range("A12:B2000").Copy (Sheets("Floors").Range("A12"))
Sheets("Floors").Activate
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Display More
And this is what I have in the sheet;
Code
Sub RefreshN()
'Refresh item number columns
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("N").Activate
Range("A12:B2000").Copy (Sheets("Floors").Range("A12"))
Sheets("Floors").Activate
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Display More
I've commented out all lines and brought them back one at a time until I get the error, which is with the range to be copied...
I changed copy to select just to confirm this.
Why is this code working from a userform, but not from a sheet?
Once again, your wisdom is appreciated.