Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Steach91
 
Posts: n/a
Default Macro to show a button?


Is it possible to a worksheet that hides a command button, and then a
macro is called, and allow the macro to unhide a command button?

Example:
Macro is run:
If Cell A1 = 100 then borrower can see the command button
if Cell A1 < 100 then borrower can't see the command button

Is this even possible using VBA?


--
Steach91
------------------------------------------------------------------------
Steach91's Profile: http://www.excelforum.com/member.php...o&userid=30234
View this thread: http://www.excelforum.com/showthread...hreadid=554655

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bearacade
 
Posts: n/a
Default Macro to show a button?


Sure there is, try this:

If ActiveSheet.Shapes("CommandButton1").Visible = True Then
ActiveSheet.Shapes("CommandButton1").Visible = False
ElseIf ActiveSheet.Shapes("CommandButton1").Visible = False Then
ActiveSheet.Shapes("CommandButton1").Visible = True
End If


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=554655

  #3   Report Post  
Posted to microsoft.public.excel.misc
JLatham
 
Posts: n/a
Default Macro to show a button?

You can simplify that even more to become a toggle switch by using this code

ActiveSheet.Shapes("CommandButton1").Visible =
Not(ActiveSheet.Shapes("CommandButton1").Visible)

it will flip flop back and forth between Visible/Not Visible (True/False)
each time it's called.

"Bearacade" wrote:


Sure there is, try this:

If ActiveSheet.Shapes("CommandButton1").Visible = True Then
ActiveSheet.Shapes("CommandButton1").Visible = False
ElseIf ActiveSheet.Shapes("CommandButton1").Visible = False Then
ActiveSheet.Shapes("CommandButton1").Visible = True
End If


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=554655


  #4   Report Post  
Posted to microsoft.public.excel.misc
Brian G
 
Posts: n/a
Default Macro to show a button?

Here are some ideas:
1) hide and unhide a row/column
2) this is just a thought, but userforms have the .show method, and I'm not
sure if that would apply to something like a command button offhand.
3) use a drawing object and change the color from gray to no color.

"Steach91" wrote:


Is it possible to a worksheet that hides a command button, and then a
macro is called, and allow the macro to unhide a command button?

Example:
Macro is run:
If Cell A1 = 100 then borrower can see the command button
if Cell A1 < 100 then borrower can't see the command button

Is this even possible using VBA?


--
Steach91
------------------------------------------------------------------------
Steach91's Profile: http://www.excelforum.com/member.php...o&userid=30234
View this thread: http://www.excelforum.com/showthread...hreadid=554655


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
how to create a command button, then assign macro to it in excel kshaheen Excel Discussion (Misc queries) 3 June 24th 08 01:03 PM
Creating a macro that simulates some of the toolbar button Duangruthai New Users to Excel 1 April 22nd 06 12:12 AM
Custom Toolbar Button No Longer Runs Assigned Macro Bryan Excel Discussion (Misc queries) 1 April 10th 06 06:02 PM
Cells turn 'hot' and execute distant macro button Kevryl Excel Discussion (Misc queries) 1 March 31st 06 02:08 PM
Button not bring up Macro I created A.S. Excel Discussion (Misc queries) 1 July 22nd 05 10:21 PM


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

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"