Forum Discussion
Selecting an Excel Range in VBA
Thanks much for the response, but what you listed is what I tried.
The code is in a CommandButton click event which is in the worksheet "Weekly" and the area to be selected is in Worksheet "Groups"
The following code Works
Worksheets("Groups").Activate
Sheets("Groups").Range("B2:L34").Select
The following does not work
Worksheets("Groups").Activate
Sheets("Groups").Range(Cells(2,4), Cells(34,12)).Select '(error occurs on this line of code)
(I removed the variable names and replaced with numbers)
The error message is Application-defined or object-defined error
WallisMcMath But it worked for me when I took the code and created a Sub with it. See attached!
- WallisMcMathMay 06, 2020Copper Contributor
Thanks for looking, I have no idea why the code does not work for me. I will keep trying to find something.