Open a userform of one spread sheet with another spread sheet

S

s_smith_iet

I am wondering how I can open "userform16" from a spread sheet called
"NPI data entry form" with another spread sheet called "TEAH entry"

Both sheets would be open
 
G

Gary Keramidas

one way. in the workbook with the userform, i used a workbook named weekly.xls:

Sub test2()
UserForm16.Show
End Sub


then in the other workbook

Sub test()
Application.Run "Weekly.xls!test2"
End Sub
 
S

s_smith_iet

one way. in the workbook with the userform, i used a workbook named weekly.xls:

Sub test2()
UserForm16.Show
End Sub

then in the other workbook

Sub test()
Application.Run "Weekly.xls!test2"
End Sub

--

Gary







- Show quoted text -

If I run the macro to run the userform from the same spread sheet it
works but if I run the macro that runs the macro I get a subscript out
of range error
 
G

Gary Keramidas

not sure what's going on without seeing it.

--


Gary


one way. in the workbook with the userform, i used a workbook named
weekly.xls:

Sub test2()
UserForm16.Show
End Sub

then in the other workbook

Sub test()
Application.Run "Weekly.xls!test2"
End Sub

--

Gary







- Show quoted text -

If I run the macro to run the userform from the same spread sheet it
works but if I run the macro that runs the macro I get a subscript out
of range error
 
S

s_smith_iet

when i use this:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Run "NPI data entry form.xls!Macro1"
End Sub

it says it cannot find the macro

when i use this
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Run "'NPI data entry form.xls'!Macro1"
End Sub

i get subcript out of range
 

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