Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_Click()
if isnumeric(Range("A1").Value) then if Range("A1").Value -1 < 0 then Range("A1").Value = 0 CommandButton1.Enabled = False Else Range("A1").Value = Range("A1").Value - 1 End if End if End Sub -- Regards, Tom Ogilvy "Pete" wrote in message ... Hi, can anyone help me with a problem using excel macros? I have a macro that will take away numbers from a value that is provided in Cell A1. The problem is that when the cell reaches Zero i would like to stop the button from working. Because at the moment all i get is A1 going into minus figures and that makes the rest of the spreadsheet go wrong. Thanks for looking. Pete |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable the save button | Excel Discussion (Misc queries) | |||
Disable X button on excel | Excel Worksheet Functions | |||
Disable Close Button | Excel Discussion (Misc queries) | |||
Disable Exit button on a UserForm | Excel Discussion (Misc queries) | |||
How do you disable the Collate button? | Excel Discussion (Misc queries) |