Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2024, 02:28 AM
School Boy Error School Boy Error is offline Change Focus From Userform After Click Windows 11 Change Focus From Userform After Click Office 2021
Novice
Change Focus From Userform After Click
 
Join Date: Sep 2024
Posts: 4
School Boy Error is on a distinguished road
Default Change Focus From Userform After Click

I have a userform that fills a table cell either red, amber or green to RAG rate reports - something I do a lot, so this is a really good time saver. My issue is that I have to click twice to return to select the next cell. So:

Current cell active, click colour button on userform and it fills the cell (great)
Userform remains active, so I need to click the document away from the userform to gain focus, then click the next cell I want (not so great).



https://www.loom.com/share/c34bdc89d...f-2ffceee0e374
Reply With Quote
  #2  
Old 09-21-2024, 10:43 AM
gmaxey gmaxey is offline Change Focus From Userform After Click Windows 10 Change Focus From Userform After Click Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

I'm assuming you must be displaying the form with .Show vbModeless.


In each command button event. Add Application.Activate


Private Sub CommandButton1_Click()
Selection.Cells(1).Shading.BackgroundPatternColor = wdColorAqua
Application.Activate
End Sub
Private Sub CommandButton2_Click()
Selection.Cells(1).Shading.BackgroundPatternColor = wdColorBlue
Application.Activate
End Sub
Private Sub CommandButton3_Click()
Selection.Cells(1).Shading.BackgroundPatternColor = wdColorBrightGreen
Application.Activate
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 09-21-2024, 11:27 AM
School Boy Error School Boy Error is offline Change Focus From Userform After Click Windows 11 Change Focus From Userform After Click Office 2021
Novice
Change Focus From Userform After Click
 
Join Date: Sep 2024
Posts: 4
School Boy Error is on a distinguished road
Default

Spot on - thank you! I spent 20 minutes with ChatGPT trying to do this and it couldn't figure it out - works a dream, thank you!
Reply With Quote
  #4  
Old 09-21-2024, 11:34 AM
gmaxey gmaxey is offline Change Focus From Userform After Click Windows 10 Change Focus From Userform After Click Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Its ChatGPT one of those Artificial Idiots? If so, no wonder.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #5  
Old 09-21-2024, 11:37 AM
School Boy Error School Boy Error is offline Change Focus From Userform After Click Windows 11 Change Focus From Userform After Click Office 2021
Novice
Change Focus From Userform After Click
 
Join Date: Sep 2024
Posts: 4
School Boy Error is on a distinguished road
Default

Ha, that's it - got me half way there creating the form and the buttons but not the rest!
Reply With Quote
  #6  
Old 09-21-2024, 11:45 AM
gmaxey gmaxey is offline Change Focus From Userform After Click Windows 10 Change Focus From Userform After Click Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

A shame really. Those gizmos have cut the volume in these forums to a trickle. From my experience, the solutions they provide are usually half baked, if that.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #7  
Old 09-21-2024, 11:59 AM
School Boy Error School Boy Error is offline Change Focus From Userform After Click Windows 11 Change Focus From Userform After Click Office 2021
Novice
Change Focus From Userform After Click
 
Join Date: Sep 2024
Posts: 4
School Boy Error is on a distinguished road
Default

Absolutely true - I used it for something for my website, wrote me a php function that worked a treat. I asked, "is this secure?" The response was essentially, "oh no, not at all."

It's useful it you have some knowledge - but like this example, I don't know what I don't know so how no idea how to fix it so was clearly asking the wrong questions.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Focus From Userform After Click Hyperlink object - change ctrl+click to click? ld2x07 Word 5 10-10-2014 05:13 AM
Change focus from userForm back to word document to see results. Hank Smith Word VBA 1 08-11-2014 05:00 AM
Change Focus From Userform After Click Show userform without losing document focus? Or other method to get a graphic to pop? AlexR Word VBA 7 03-31-2013 12:17 PM
Title: Why does focus fail to change to MyPic2.jpg (intermittently) after .addPictur CatMan PowerPoint 6 05-10-2012 10:25 PM
Change Focus From Userform After Click Setting focus to specific word document from UserForm SaneMan Word VBA 5 04-01-2011 03:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft