Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Per Jessen helped me with some code, and he did a great job, but I guess I didn't ask for what would be the best! (Sorry Per) Do you know how I would modify this code so it could be added and performed from a form button instead of a command button? (It's really useful already, but now I'm thinking it should have been a form button.) Also, is there any way that it could automatically replace (not ask) if the value of C33 is 0 (zero), as well as empty? Private Sub CommandButton1_Click() If Range("W6").Value < "" And Range("W6").Value < 0 Then If Sheets("Quick Calculator").Range("C33").Value < "" Then answer = MsgBox("Do you want to replace existing value for Thing 1?", vbYesNo) If answer = vbYes Then Sheets("Quick Calculator").Range("C33") = Me.Range("W6").Value Else Sheets("Quick Calculator").Range("C33") = Me.Range("W6").Value End If End If End Sub Thank you for any suggestions! Ben |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Form Button vs Command Button | Excel Programming | |||
User form and Command button | Excel Discussion (Misc queries) | |||
Form Command Button Problem.. | Excel Programming | |||
Command Button vs Form Button | Excel Programming | |||
Command Button vs Form Button | Excel Programming |