Sheet Focus

Roderick_E

Well-known Member
Joined
Oct 13, 2007
Messages
2,051
I'm using a Userform.show vbmodeless to float above the worksheet I'm using. I'm having to utilize form buttons to interact/transfer data between one workbook and another and I sometimes click between the sheets.
THE PROBLEM:
Sometimes when I click on one workbook's sheet, it seems to think it is still on there other sheet. I have to close the Userform to regain proper focus. What can I do? Thanks
 
Fingers crossed :)
Unfortunately it DIDN'T work. I'm trying to force the sheet to select but it seems to often "ghost" select the another sheet, she as I manually select cells on the intended sheet, it moves around the same cells on the another sheet.
here's my code to attempt forced selection
Code:
Windows(wwsh.Parent.Name).Activate
wwbk.Activate
wwsh.Activate
wwsh.Select
wwsh.Range("A2").Select 'force selection
Application.Goto reference:=wwsh
lastrowwwsh = wwsh.Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
wwsh.Range("A" & lastrowwwsh + 1).Select
UserForm1.Show vbModeless
it does everything I tell it to do above but randomly still does the ghost selecting of the other sheet.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Unfortunately I have no idea & it's going to be difficult to track down if, it works sometimes, but not others.
 
Upvote 0
Unfortunately I have no idea & it's going to be difficult to track down if, it works sometimes, but not others.
Actually now it seems to be consistently failing. Since it is reverting to a sheet within the Workbook where the actual macro/userform is housed, I suspect that is a clue. Still looking
 
Upvote 0
It has something to do with the userform because if I close it, everything reverts correctly. UGH!!! I want my userform hahaha
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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