I want to copy a range of cells from one sheet to another using either an activeX or VBA control button. I'm stuck on the syntax for the pasting destination. Thanks for any help.
I want to copy a range of cells from one sheet to another using either an activeX or VBA control button. I'm stuck on the syntax for the pasting destination. Thanks for any help.
Please post your code
Private Sub UPDATE1_Click()
Range("N2:N389").Copy
End Sub
Okay! this linecopies the range, but where exactly do you wish to paste these range? Do you also wish to just copy values only, or you do not care?Please Login or Register to view this content.
Yes, I want to copy values only. I want to copy to this range ("G2:G389") but it's on the first sheet and the range("N2:N389) is on the second sheet or rather the active sheet where the control lives.
No problem
Please Login or Register to view this content.
That looks great but when I run it I get a Subscript out of Range runtime error.
Well! I do not know what is the issue. I have tested it on the same data and same sheet name, it works. Could you please run the code and see in which line shows(you)-highlighted with yellow?
It is the first line, the one that copies the range
Ah, problem solved. Stupid me. My Sheets where not named sheet1 and sheet2. Fixed that and it works great!! Thanks so much for your help!
This onecould you make sure that the sheet name is the same as ("sheet2").No space, or spelling error?. You could copy the name as it by going to the sheet tab- Copy and paste the name.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks