#1
|
||||
|
||||
Remove toggle button "focus" (dotted inner border) using VBA
Hi folks
I have a number of toggle buttons dotted around my spreadsheet - not part of a userform - and every time I click on them the "focus" remains on the button, i.e. a dotted inner border appears. I have to click away from the button (to remove the dotted border) before I can use various menu items which are otherwise greyed out. It would appear that Excel 2003 does not include the "TakeFocusOnClick" option - which I think is what I need. Is there a way of removing the button focus another way using VBA? Thanks, Matt |
#2
|
|||
|
|||
What about :
Range("A1").Select ??? |
#3
|
||||
|
||||
Would that not shoot the selection back up to the top of the spreadsheet? I have buttons in a frozen top pane so would rather the window stayed as it was.
|
#4
|
|||
|
|||
Yes it would.
Where would you like the focus to go ? |
#5
|
||||
|
||||
I would like to avoid the dotted border appearing on the button and keep the currently-selected cell selected (or highlighted, whatever the terminology may be).
|
#6
|
|||
|
|||
I don't understand how you can have a currently selected cell and the focus still remain on the toggle button.
Best answers here are derived by posting your workbook for review. Do not include confidential information. |
#7
|
||||
|
||||
Include
ActiveCell.Activate somewhere in the toggle button's code. (If you're using triplestate on the button, the click event won't fire when it becomes null, so use another event such as the mouseup or change event.) |
#8
|
||||
|
||||
That did the trick. Many thanks, p45cal.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How Do I Get Rid of This Dotted Border Around a Table in Word 2016? | ARNK | Word | 3 | 11-02-2016 05:04 PM |
Toggle Button takes focus and thus changes selection | NobodysPerfect | Word VBA | 1 | 10-11-2014 04:20 AM |
Toggle Button | Squibble | Word VBA | 2 | 06-11-2014 05:36 PM |
dotted lines under text -- how to remove? | Straitsfan | Word | 1 | 11-11-2013 11:55 AM |
How to remove the dotted lines from a table of content? | aleemu | Word | 2 | 06-21-2013 08:20 AM |