Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change focus from Userform back to Sheet

How do I programmatically change focus from a userform back to
worksheet?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Change focus from Userform back to Sheet

Try

AppActivate Application.Caption


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"rocketslinger" wrote
in message ...
How do I programmatically change focus from a userform back to
worksheet?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change focus from Userform back to Sheet

Tried that. Doesn't work. Unless I am placing the code in the wrong
section of my code. Where would be the best place to insert the code?


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
COM COM is offline
external usenet poster
 
Posts: 40
Default Change focus from Userform back to Sheet

I have not found that it is possible to have a Userform visible and to focus on the worksheet.

VBA does not allow non modal Userforms. (Which is what it sounds like you are trying to accomplish)

You can still programmatically modify the worksheet while the userform is visible, but the user can not modify the worksheet while the Userform is visible.

You may have to find another way around what you are trying to do. :\
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change focus from Userform back to Sheet

I have been looking for a solution to this problem for a long time. I
still don't have it. But I don't agree with the previous reply.

You CAN have a userform visible while you work in the worksheet.
I have a permanent userform visible simply by a macro like
Worksheet.activate ... Userform.Show.
I enter codes from a listbox in the userform to cells in the worksheet.
Subsequently, I click on the worksheet to set the focus on the
worksheet and then I can work in the sheet. Meanwhile the userform is
still visible!
As this is possible, I am looking for a programming code that
automatically brings back the focus to the worksheet (after I have
chosen from the listbox in the userform).

Userform.Hide is therefor not appropriate.
Worksheet.activate does not do what we want.

We'll wait for suggestions...


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Change focus from Userform back to Sheet

Use AppActivate to return focus back to the worksheet. E.g.,

Private Sub CommandButton1_Click()
AppActivate Application.Caption
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"evanhaarst " wrote in
message ...
I have been looking for a solution to this problem for a long

time. I
still don't have it. But I don't agree with the previous reply.

You CAN have a userform visible while you work in the

worksheet.
I have a permanent userform visible simply by a macro like
Worksheet.activate ... Userform.Show.
I enter codes from a listbox in the userform to cells in the

worksheet.
Subsequently, I click on the worksheet to set the focus on the
worksheet and then I can work in the sheet. Meanwhile the

userform is
still visible!
As this is possible, I am looking for a programming code that
automatically brings back the focus to the worksheet (after I

have
chosen from the listbox in the userform).

Userform.Hide is therefor not appropriate.
Worksheet.activate does not do what we want.

We'll wait for suggestions...


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus back from modeless userform to sheet RB Smissaert Excel Programming 4 September 5th 03 04:21 PM
UserForm Loss Focus Orlando Magalhães Filho Excel Programming 2 September 5th 03 04:47 AM
Must be a way to force focus back to sheet instead of UserForm - isn't there? Les[_4_] Excel Programming 2 July 29th 03 12:45 PM
How to set focus back to sheet after showing a user form Stephen Bullen Excel Programming 0 July 22nd 03 10:34 AM
How to set focus back to sheet after showing a user form Les[_4_] Excel Programming 0 July 21st 03 07:58 PM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"