Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi, I have a macro that is flipping between two windows. I recorded it and I'm running into an error. The sheet I was playing around with and recorded it on was called Book1. The macro will be run on sheets with different names. The debugger is highlighting this line: Windows("Book1.xls").Activate How do I make windows go the other open workbook no matter what the name is? Thanks Eddie -- punter ------------------------------------------------------------------------ punter's Profile: http://www.excelforum.com/member.php...fo&userid=2044 View this thread: http://www.excelforum.com/showthread...hreadid=554196 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() try taking the .xls out.. Windows("Book1").Activate -- Bearacade ------------------------------------------------------------------------ Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016 View this thread: http://www.excelforum.com/showthread...hreadid=554196 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi I guess the problem is that new workbooks won't always be called "book1". You could save the new workbook as soon as it's opened in the macro, thereby giving it a set name and changin the macro to reflect that name. Alternatively you could prompt the user to tell the macro what the workbook name is and then refer to that. Hope this helps Colin -- Colin Vicary ------------------------------------------------------------------------ Colin Vicary's Profile: http://www.excelforum.com/member.php...o&userid=10472 View this thread: http://www.excelforum.com/showthread...hreadid=554196 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This should work if you have only two workbooks open:
For j=1 to workbooks.count if workbooks(j).name<activeworkbook.name then workbooks(j).activate exit for end if next j James punter wrote: Hi, I have a macro that is flipping between two windows. I recorded it and I'm running into an error. The sheet I was playing around with and recorded it on was called Book1. The macro will be run on sheets with different names. The debugger is highlighting this line: Windows("Book1.xls").Activate How do I make windows go the other open workbook no matter what the name is? Thanks Eddie -- punter ------------------------------------------------------------------------ punter's Profile: http://www.excelforum.com/member.php...fo&userid=2044 View this thread: http://www.excelforum.com/showthread...hreadid=554196 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro question | Excel Discussion (Misc queries) | |||
general macro question | Excel Discussion (Misc queries) | |||
Macro Button Question | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Bob Phillips followup question on text macro | Excel Discussion (Misc queries) |