Remote module call

  • Thread starter Patrick Simonds
  • Start date
P

Patrick Simonds

I have 2 open workbooks Able and Baker

In WorkBook Able I call a Userform which has a ListBox. The ControlSource
for the ListBox is a range located on WorkBook Baker. The ListBox shows a
list of employees and their department. I want a sort button on my UserForm
which will run a sort routine on the workbook Baker which has the employee
data.

I have the Sort routines defined on WorkBook Baker :

Module1.SortByName
Module1.SortByDepartment

But how do I run the sort module on WorkBook Baker without leaving WorkBook
Able?
 
R

RaceEend

Patrick said:
I have 2 open workbooks Able and Baker

In WorkBook Able I call a Userform which has a ListBox. The
ControlSource for the ListBox is a range located on WorkBook Baker.
The ListBox shows a list of employees and their department. I want a
sort button on my UserForm which will run a sort routine on the
workbook Baker which has the employee data.

I have the Sort routines defined on WorkBook Baker :

Module1.SortByName
Module1.SortByDepartment

But how do I run the sort module on WorkBook Baker without leaving
WorkBook Able?

Application.Run "'Baker'!SortByName"
or if you have parameters
Application.Run "'Baker'!SortByName", Parameter1, Parameter2,..

Workbook Baker shouldbe open.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top