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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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,213,506
Messages
6,114,027
Members
448,543
Latest member
MartinLarkin

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