Forum Discussion
Selecting an Excel Range in VBA
If you just want to select B2:L34 in the Groups sheet as you describe, the following code lines will work.
DateR = 2
NameC = 2
LastNameR = 34
GFriIndexC = 12
Sheets("Groups").Range(Cells(DateR, NameC), Cells(LastNameR, GFriIndexC)).Select
What you want to do with it, once selected (copy, clear, delete, change format etc.), is another issue.
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