buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
i have a sequence of userforms used to input various codes into field. That all work great and go from flawlessly, until lately. I added vbmodeless to make cells selectable on one of the forms (everything still worked great. I then added a hyperlink to that same userform (opens up a different spreadsheet for ref.) Now when I go from one userform to the one that has the hyperlink (and vbmodeless) I have to select the userform/textbox with the mouse (its lookslike something else is selected) where i didnt have to do that before.

Hopefully this is explained well enough.

(this is just to show how the one before ".show"s)
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("Data Sheet").Select
Range("Letdown").Value = TextBox1.Value
Application.ScreenUpdating = True
Unload Me
FTIRThickness.Show vbModeless
End Sub

(this is the one i am trouble with)
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Windows("Quality Control Data Sheet (BETA).xls").Activate
Sheets("Data Sheet").Select
Range("FTIRThickness").Value = TextBox1.Value
Application.ScreenUpdating = True
Unload Me
Packaging.Show
End Sub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
you could add a _activate event to the userform and use .setfocus to reposition your focus back to the required textbox, which must be getting lost somehow.
 
Upvote 0
Thanks for the advice, I'll try it tomorrow at work. My code is indented on my vbe but when I copied and pasted it onto the forum I just sent it. I wish I could box it in but have no idea how or if I can
 
Upvote 0
Add tags to your code like:
[code=rich]
'your code here
[/code]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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