Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook Reference for Macros
How can I control the workbook reference when I assign a
macro to a toolbar button? I want the workbook reference to always be the current workbook. TIA, Rich |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook Reference for Macros
I'm sure the gurus can explain this in more detail, but basically ThisWorkbook
refers to the workbook the macro is stored in, and ActiveWorkbook refers to the - yes - active workbook. Enter the following macro in a code module: '---- Public Sub WorkbookNames() MsgBox "This = " & ThisWorkbook.Name & " Active = " & ActiveWorkbook.Name End Sub '---- HTH Anders Silvén "Rich" skrev i meddelandet ... How can I control the workbook reference when I assign a macro to a toolbar button? I want the workbook reference to always be the current workbook. TIA, Rich |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing Column Reference in Macros? | Excel Discussion (Misc queries) | |||
Appropriate use of cell reference when creating macros | Excel Discussion (Misc queries) | |||
Relative Reference Help Macros | Excel Worksheet Functions | |||
how do the macros get data from te reference tables? | Excel Discussion (Misc queries) | |||
How do I save a workbook as a new workbook by using macros? | Excel Discussion (Misc queries) |