Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Using Refedit with other workbook

I need to let the user select ranges from other open workbooks. The Refedit
doesn't seem to allow switiching to another workbook when it is in use. Does
anyone know any way around this for excel 2003?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Using Refedit with other workbook

Steve,
Seems that the RefEdit can only work with the activeWorkbook, so Activate
the required book:

Private Sub UserForm_Initialize()
Workbooks("Book2.xls").Activate
End Sub

NickHK

"Steve" wrote in message
...
I need to let the user select ranges from other open workbooks. The

Refedit
doesn't seem to allow switiching to another workbook when it is in use.

Does
anyone know any way around this for excel 2003?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Using Refedit with other workbook

Is there any way to do this without knowing the name of the workbook or
worksheet (the user chooses the workbook, in which I don't necessarily know
the name of the workbook)?

"NickHK" wrote:

Steve,
Seems that the RefEdit can only work with the activeWorkbook, so Activate
the required book:

Private Sub UserForm_Initialize()
Workbooks("Book2.xls").Activate
End Sub

NickHK

"Steve" wrote in message
...
I need to let the user select ranges from other open workbooks. The

Refedit
doesn't seem to allow switiching to another workbook when it is in use.

Does
anyone know any way around this for excel 2003?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Using Refedit with other workbook

If there's something unique in that other workbook, you could look for it and
then activate the workbook where you found it.

If you opened the other workbook in code, then you know what workbook to
activate:

In a General module

Public OtherWkbk as workbook

....later in someroutine...

set otherwkbk = workbooks.open(filename:=....)

Then in your useform code:
Private Sub UserForm_Initialize()
otherwkbk.activate
end sub

Or you could tell the user to choose from the list of open workbooks/windows
under the Window option on the worksheet menubar.

Steve wrote:

Is there any way to do this without knowing the name of the workbook or
worksheet (the user chooses the workbook, in which I don't necessarily know
the name of the workbook)?

"NickHK" wrote:

Steve,
Seems that the RefEdit can only work with the activeWorkbook, so Activate
the required book:

Private Sub UserForm_Initialize()
Workbooks("Book2.xls").Activate
End Sub

NickHK

"Steve" wrote in message
...
I need to let the user select ranges from other open workbooks. The

Refedit
doesn't seem to allow switiching to another workbook when it is in use.

Does
anyone know any way around this for excel 2003?





--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Using Refedit with other workbook

How would you do this in code?

"Or you could tell the user to choose from the list of open workbooks/windows
under the Window option on the worksheet menubar."


"Dave Peterson" wrote:

If there's something unique in that other workbook, you could look for it and
then activate the workbook where you found it.

If you opened the other workbook in code, then you know what workbook to
activate:

In a General module

Public OtherWkbk as workbook

....later in someroutine...

set otherwkbk = workbooks.open(filename:=....)

Then in your useform code:
Private Sub UserForm_Initialize()
otherwkbk.activate
end sub

Or you could tell the user to choose from the list of open workbooks/windows
under the Window option on the worksheet menubar.

Steve wrote:

Is there any way to do this without knowing the name of the workbook or
worksheet (the user chooses the workbook, in which I don't necessarily know
the name of the workbook)?

"NickHK" wrote:

Steve,
Seems that the RefEdit can only work with the activeWorkbook, so Activate
the required book:

Private Sub UserForm_Initialize()
Workbooks("Book2.xls").Activate
End Sub

NickHK

"Steve" wrote in message
...
I need to let the user select ranges from other open workbooks. The
Refedit
doesn't seem to allow switiching to another workbook when it is in use.
Does
anyone know any way around this for excel 2003?




--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Using Refedit with other workbook

I think telling the user to use that window option is more of a training issue.
But there's nothing wrong about adding a label to the userform with instructions
to the user.

Or maybe add a help button to the userform.

If you don't want to become a .hlp/.chm author, you may want to look at how John
Walkenbach does it:

http://j-walk.com/ss/excel/tips/tip51.htm

Steve wrote:

How would you do this in code?

"Or you could tell the user to choose from the list of open workbooks/windows
under the Window option on the worksheet menubar."

"Dave Peterson" wrote:

If there's something unique in that other workbook, you could look for it and
then activate the workbook where you found it.

If you opened the other workbook in code, then you know what workbook to
activate:

In a General module

Public OtherWkbk as workbook

....later in someroutine...

set otherwkbk = workbooks.open(filename:=....)

Then in your useform code:
Private Sub UserForm_Initialize()
otherwkbk.activate
end sub

Or you could tell the user to choose from the list of open workbooks/windows
under the Window option on the worksheet menubar.

Steve wrote:

Is there any way to do this without knowing the name of the workbook or
worksheet (the user chooses the workbook, in which I don't necessarily know
the name of the workbook)?

"NickHK" wrote:

Steve,
Seems that the RefEdit can only work with the activeWorkbook, so Activate
the required book:

Private Sub UserForm_Initialize()
Workbooks("Book2.xls").Activate
End Sub

NickHK

"Steve" wrote in message
...
I need to let the user select ranges from other open workbooks. The
Refedit
doesn't seem to allow switiching to another workbook when it is in use.
Does
anyone know any way around this for excel 2003?




--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To refedit, or not to refedit, that is the question. davegb Excel Programming 2 October 25th 06 08:19 PM
RefEdit ??? T.c.Goosen1977[_21_] Excel Programming 0 July 3rd 06 03:11 PM
RefEdit on Userform to pick up range in another workbook jase[_2_] Excel Programming 1 June 2nd 05 04:29 PM
RefEdit - get range from another workbook pbengtss Excel Programming 4 September 18th 04 02:42 AM
RefEdit - cannot select range on another workbook Rob Excel Programming 1 November 26th 03 07:48 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"