Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cannot Find Button From Control Properties

Hello,
On my worksheet, I have dropped a button control from the Forms
Toolbar. I have aasigned a macro to the button. The on click event
(??) of the button fires the macro properly, and I get the results I
expect. However, a cell has to be edited before the button can be
clicked. Before the button is clickable, I have to be out of edit
mode.

In VBA, I cannot find a way to reference this button control. The
button is not in a form, its embedded within the worksheet. I would
like to be able to exit edit mode when I mouseOver the button.

What should I do?

Thank you for your help!

cdun2

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Cannot Find Button From Control Properties

You are out of luck on that one. No code will run while a cell is in edit
mode. No events fire... Nothing...

That being said you can reference a button from the forms toolbar like this...
MsgBox Sheets("Sheet1").Buttons("Button 1").Caption

--
HTH...

Jim Thomlinson


"cdun2" wrote:

Hello,
On my worksheet, I have dropped a button control from the Forms
Toolbar. I have aasigned a macro to the button. The on click event
(??) of the button fires the macro properly, and I get the results I
expect. However, a cell has to be edited before the button can be
clicked. Before the button is clickable, I have to be out of edit
mode.

In VBA, I cannot find a way to reference this button control. The
button is not in a form, its embedded within the worksheet. I would
like to be able to exit edit mode when I mouseOver the button.

What should I do?

Thank you for your help!

cdun2


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Cannot Find Button From Control Properties

Here is a solution you might want to persue. When the cell is finished being
edited you could make the button visible (or enabled although that
functionallity is not to great in buttons from the forms toolbar as the
button is not greyed out). Plece code similar to this in the sheet where you
have the cell to be edited...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then 'Where A1 is the edited cell
Sheets("Sheet1").Buttons("Button 1").Visible = False
else
Sheets("Sheet1").Buttons("Button 1").Visible = True
End If
End Sub

This code is only a sample and not intended as your final code. I am unclear
as to when this code is valid to be run and how you want the button to work...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

You are out of luck on that one. No code will run while a cell is in edit
mode. No events fire... Nothing...

That being said you can reference a button from the forms toolbar like this...
MsgBox Sheets("Sheet1").Buttons("Button 1").Caption

--
HTH...

Jim Thomlinson


"cdun2" wrote:

Hello,
On my worksheet, I have dropped a button control from the Forms
Toolbar. I have aasigned a macro to the button. The on click event
(??) of the button fires the macro properly, and I get the results I
expect. However, a cell has to be edited before the button can be
clicked. Before the button is clickable, I have to be out of edit
mode.

In VBA, I cannot find a way to reference this button control. The
button is not in a form, its embedded within the worksheet. I would
like to be able to exit edit mode when I mouseOver the button.

What should I do?

Thank you for your help!

cdun2


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cannot Find Button From Control Properties

Thanks for this input, I'll try this approach.

On Jun 11, 6:09 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
Here is a solution you might want to persue. When the cell is finished being
edited you could make the button visible (or enabled although that
functionallity is not to great in buttons from the forms toolbar as the
button is not greyed out). Plece code similar to this in the sheet where you
have the cell to be edited...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then 'Where A1 is the edited cell
Sheets("Sheet1").Buttons("Button 1").Visible = False
else
Sheets("Sheet1").Buttons("Button 1").Visible = True
End If
End Sub

This code is only a sample and not intended as your final code. I am unclear
as to when this code is valid to be run and how you want the button to work...
--
HTH...

Jim Thomlinson



"Jim Thomlinson" wrote:
You are out of luck on that one. No code will run while a cell is in edit
mode. No events fire... Nothing...


That being said you can reference a button from the forms toolbar like this...
MsgBox Sheets("Sheet1").Buttons("Button 1").Caption


--
HTH...


Jim Thomlinson


"cdun2" wrote:


Hello,
On my worksheet, I have dropped a button control from the Forms
Toolbar. I have aasigned a macro to the button. The on click event
(??) of the button fires the macro properly, and I get the results I
expect. However, a cell has to be edited before the button can be
clicked. Before the button is clickable, I have to be out of edit
mode.


In VBA, I cannot find a way to reference this button control. The
button is not in a form, its embedded within the worksheet. I would
like to be able to exit edit mode when I mouseOver the button.


What should I do?


Thank you for your help!


cdun2- Hide quoted text -


- Show quoted text -


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
Control Box Properties Montana Excel Discussion (Misc queries) 1 August 7th 07 04:38 PM
Command Button Control Properties JosiahW Excel Discussion (Misc queries) 1 May 11th 07 08:45 PM
I can't find the command button control object in Excel 2007 Raas Excel Discussion (Misc queries) 4 April 2nd 07 03:46 PM
Control Properties Lee Hunter Excel Programming 2 September 10th 04 03:10 PM
Change Control properties in VBE Sandy V Excel Programming 2 July 30th 03 09:14 AM


All times are GMT +1. The time now is 10:46 AM.

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

About Us

"It's about Microsoft Excel"