Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() With two open workbooks and knowing the name of one only (let's call th one we know the name of wb1.xls), is there a way to make wb1.xls th inactive workbook and make the other one (we don't know the name) th active one??? thanks: -- halem ----------------------------------------------------------------------- halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993 View this thread: http://www.excelforum.com/showthread.php?threadid=55013 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a Module, try:
Sub aa() If Workbooks(1).Name = "wb1" Then Workbooks(2).Activate Else Workbooks(1).Activate End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() the problem isI don't know the name of the other workbook until it is emailed to me. I would need to edit the macro everytime if I use that procedure. I need to make the Active workbook the one I receive not wb1 -- halem2 ------------------------------------------------------------------------ halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930 View this thread: http://www.excelforum.com/showthread...hreadid=550132 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thanks. Tried it but doen not work -- halem ----------------------------------------------------------------------- halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993 View this thread: http://www.excelforum.com/showthread.php?threadid=55013 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You said:
The workbook whose name you know is wkb1.xls; workbook(n).Name returns the name of its workboom without extension xls. The code has no reference to the name of the other workbook BUT it does assume that you have it open in the same session of Excel. Then the code works: it does what you asked for. That is make the 'other' workbok the active workbook. Did you ask for what you wanted? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I think I did... The actual error says "subscript out of range..erro 9". both workbooks have several worksheets, one over 90 and the other on over 30. When the macro worked, it would (using another sub I have match the ws names on both and copy the cell ranges from one to th other, then go to the next matching set of ws and do the same until i copied all specified cell ranges from all ws. it baffles me that it actually worked for a few weeks and it jus stopped working. No one else has access to it and it is passworded -- halem ----------------------------------------------------------------------- halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993 View this thread: http://www.excelforum.com/showthread.php?threadid=55013 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing Hidden Workbook when Active Workbook is Closed | Excel Programming | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
How do I make an open workbook the active workbook | Excel Programming | |||
Copy Modules from One workbook to Active Workbook | Excel Programming | |||
Preventing opening workbook inside active workbook. | Excel Programming |