Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
shtInpInfo is the code name for the sheet and not the tab name so I stand by
my original code. I have been helping Brad to get away from using Sheets("Tab name"). style code since it can generate errors if the end user modifies the tab name... -- HTH... Jim Thomlinson "Alan" wrote: I guess I didn't read your question correctly, and took you for a beginner, thus my simple answer. I apologize. If you were talking about the usage of shtInpinfo in the line: If shtInpInfo.Range("valid").Value < 0 Then should read If Sheets("shtInpInfo").Range("valid").Value < 0 Then Regards, Alan "Jim Thomlinson" wrote in message ... I personally avoid that kind of thing. The problem with it is "If shtInpInfo is the active sheet ". Why leave it to chance. At some point you are going to alter the flow of your program and potentially change which sheet is active and whether a named range is global or local. Now this procedure may not work any more although it is hard to tell that since it is not always obvious which sheet is active at any given time and whether a named range is global or local... you will never go wrong being more explicit than less... -- HTH... Jim Thomlinson "Alan" wrote: If shtInpInfo is the active sheet you can use this: If Range("valid").value < 0 Then shtInput.[button 17].Visible = False Beep End If If it is not the active sheet, you need to state the sheet name just as your did. "Brad" wrote in message ... My question is this Using the VBE I have rename sheetxx to shtInpinfo - Do I need the all of the following code to use the range name "valid"? If shtInpInfo.Range("valid").value < 0 Then shtInput.[button 17].Visible = False Beep End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reference Range Names in Macro | Excel Discussion (Misc queries) | |||
Rename Several Defined Range Names with Macro | Excel Programming | |||
Using range names in a macro formula | Excel Programming | |||
Macro for Range Names | Excel Programming |