Userform to stay open in a different sheet while editing

JLouis

Active Member
Joined
Jan 1, 2004
Messages
295
Office Version
  1. 365
Platform
  1. Windows
Hello. My challenge today it to successfully code the following:
I have 2 WB's, say WB1 & WB2
While using WB1 I use code to go to and work on WB2. I need a visible, floating button that I can click in WB2 to return seamlessly back to WB1.

I've tried several bits of code to open a userform in another workbook without satisfactory results.

Any suggestions would be appreciated.

Louis
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Yes. That is the macro to show in WB2. It is called from WB1 but is not working properly. There are actually 2 separate macros called in WB2. The first macro calls a specific page in WB2 to open, the 2nd one calls the userform.

Sub CallAnotherMacro()

Application.Run "'Another Workbook.xlsm'!NameOfMacro"

End Sub

I guess I need to be able to call 2 different macros in WB2.

Thank you for the reply.
 
Upvote 0
To bring this discussion full circle, this is the macro calling the first procedure:
Sub mon_o()
'

On Error GoTo ErrorHandler
Windows("276 Scheduling Program.xlsm").Activate
Application.Run "'276 Scheduling Program.xlsm'!MONDAYTemplate"
Exit Sub
ErrorHandler:
MsgBox ("The 276 Scheduling Program is not open. Please open the file and rerun the macro.")

End Sub

This works properly. So now I want to create a button that shows on the 2nd workbook that, when pressed, will take me back to the original WB. Sorry I haven't expressed myself properly.
 
Upvote 0
SOLVED:
Not sure why this is working now, but the answer to my problem was the code shown below. I wrote the TestByWorkbookName a little different on WB2.

Sub mon_o()
'
On Error GoTo ErrorHandler
Windows("276 Scheduling Program.xlsm").Activate
Application.Run "'276 Scheduling Program.xlsm'!MONDAYTemplate"
Application.Run "'276 Scheduling Program.xlsm'!TestByWorkbookName"
Exit Sub
ErrorHandler:
MsgBox ("The 276 Scheduling Program is not open. Please open the file and rerun the macro.")

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top