I hope this isn't something that has been asked before. And I REALLY hope that there is something wrong and I'm not just missing something...
I'm making a macro in Excel 2007 to clear the input ranges in a workbook. I'm using a CommandButton to start it and the procedure is in a module. Using syntax like:
Worksheets("Interview").Range("D6:D17").ClearContents
works just fine. However if I try to select or activate a Range on the same sheet without selecting the sheet first i get:
Error 1004 (Select method of Range class failed)
The following don't work to select the range
Worksheets("Interview").Range("B17").Select
(unless its after selecting the sheet)
or
Worksheets("Interview").Select
Range("B17").Select
With Worksheets("Interview")
.Range("B17").Select
End With
The only way to get it to work is select the Sheet and then select the range using the full statement. Like this:
Worksheets("Interview").Select
Worksheets("Interview").Range("B17").Select
I'm baffled. I hope its not because I'm tired...
I hope I've been clear enough and used the code tags and blocks etc right...