Thread: workbook select
View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Option explicit
sub testme01()
dim curWkbk as workbook

set curwkbk = activeworkbook
'do your stuff

curwkbk.activate
end sub

By using an object variable that represents the workbook, you don't have to rely
on the name.

Nigel wrote:

Hi,
can anyone help me with a macro to select a specific workbook that is
already open? The book is called "1234" quotes & orders
( this can be called "any number" quotes and orders
during my procedure, the book is switched to another book and fills data
from the first book. When the procedure is complete, i need to select the
original book from where i started from ("1234" quotes & orders) i might have
more books open with the same quotes and orders name but diferent "1234" at
the same time. so i would need it to do the following:

get name of active workbook as procedure starts, run prcedure and re-select
book.
the number"1234" can be found on the 2nd book at range("A1") if this helps.
i have tried alot but cannot get it to work.

regards,

nigel


--

Dave Peterson