RefEdit can not refer to another workbook.

  • Thread starter Thread starter Cactus
  • Start date Start date
C

Cactus

I made a UserForm and put a RefEdit box.

now I want refer a range at another workbook.

In my UserForm.

dim refRange as range
set refRange = Range(RefEdit)

above VBA code only correct if range in same workbook.

thank any hint.
 
Can't be so, I use it in add-ins all the time.

What are you getting in the way of feedback?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Cactus,

I think if the other workbook is the active one at the time you show the
userform, it won't include the workbook part of the reference. But if you
switch to it, it does. It doesn't seem to matter which workbook the
UserForm is in.
 
Bob

UserForm of that Workbook no Add-ins as XLA.
that workbook included by "VBA Project -- Tool -- included".
and that included workbook is XLS.
 
Thank your reply.

but it's VBA can not take _Global range.
for example, that refer text is "sheet1!a3:b8".
the "sheet1" is both in workbook1 and workbook2.

even change sheets name to unique.
VBA also can not find range "unique!a3:b8",
because that sheet at another workbook.
 
Cactus,

It sounds as if the other workbook was active when you issued the UserForm
As I said in my last post, the RefEdit box doesn't include the workbook name
in the data unless the user has switched workbooks, which is limited. Why
don't you use something like

Workbooks(BookName).Sheets("Sheet1")
 
Back
Top