Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Range error
I have an error occuring when I try to run this simple bit of code. The code
is: Sheets("Name").select Range("A2:D26").select The code is started on Sheet1 and it does change to "Name" but it says : select method of Range class failed. The code is assigned to a button. Any ideas what I have done wrong Thanks in advance |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Range error
I'd probably get rid of the SELECT altogether
Dim myWS as Worksheet Dim myRange as range On Error resume next Set myWS = Sheets("Name") On error goto 0 if myWS is nothing then MsgBox("There is no worksheet 'Name'.") End end if Set myRange = myWS.Range("A2:D26") Do all of your action on myRange. -- HTH, Barb Reinhardt "Murray" wrote: I have an error occuring when I try to run this simple bit of code. The code is: Sheets("Name").select Range("A2:D26").select The code is started on Sheet1 and it does change to "Name" but it says : select method of Range class failed. The code is assigned to a button. Any ideas what I have done wrong Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
Range error | Excel Discussion (Misc queries) | |||
Named range error | Excel Discussion (Misc queries) | |||
Error 0x800A03EC trying to set range value | New Users to Excel | |||
out of range error | New Users to Excel |