Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry for my question,
but i must write a VBA macro in Excel to analize every second a specified excel file A. The excel file is always open. the problem is this: If I open another excel file (B), the macro stop to work on A and start to work on B. It's possible to write a macro for working always on A? Thanks Nicol@ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nicol@,
Yes. Just be very specific - you must always qualify Range, cell, etc objects: Dim myBook As Workbook Dim mySheet As Worksheet Dim myRange As Range Set myBook = Workbooks("Blah blah.xls") Set mySheet = myBook.Worksheets("Sheet Name") Set myRange = mySheet.Range("A1") Then, no matter what books are open, myBook is always that one workbook, mySheet is always that one sheet from that one workbook, and myRange is always cells A1 from that one workbook / worksheet. For more specific help, post your code. HTH, Bernie MS Excel MVP "Qeltaras" wrote in message oups.com... Sorry for my question, but i must write a VBA macro in Excel to analize every second a specified excel file A. The excel file is always open. the problem is this: If I open another excel file (B), the macro stop to work on A and start to work on B. It's possible to write a macro for working always on A? Thanks Nicol@ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
saving macro from workbook to Personal Macro Workbook | Excel Discussion (Misc queries) | |||
Combine worksheets in multiple workbook in one workbook with a macro | Excel Discussion (Misc queries) | |||
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook | Excel Worksheet Functions | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please | Excel Programming |