Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet and workbook name question.
ans = Msgbox "Is the sheet we need to work with active? If not, " &
_ vbNewline & "then answer no, select the sheet and rerun the macro" if ans = vbNo then exit sub With Activesheet End With or before distributing the sheet activesheet.Range("IV1").Numberformat = """the sheet""" to check for each sh in thisworkbook.worksheets if Instr(1,sh.Range("IV1").Numberformat, "the sheet", vbTextCompare) then set thSheet = sh exit for end if Next or create a defined name that refers to the sheet (and make it hidden) range("Secret").Parent.Name -- Regards, Tom Ogilvy "Mark" wrote in message ... What is the proper way to refer to a workbook and/or a worksheet within VBA such that the code remains unaffected if the user changes either the object name or the sheet's tab position? Thanks Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy worksheet from one workbook to a master workbook | Excel Worksheet Functions | |||
Worksheet and workbook question | Excel Worksheet Functions | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
Question for Experts: Opening workbook with workbook references | Excel Programming |