View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default command button code

Here is the coding for your button. Note that with the macro, you no longer
need the formula in cell B9:

'===============
Sub UpdateTime()
'Original formula for reference
'=IF(B10="","",IF(B9="",NOW(),B9))

If Range("B10") = "" Then
x = ""
ElseIf Range("B9") = "" Then
x = Now
Else: x = Range("B9")
End If
Range("B9") = x
End Sub
'===========
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"dummy" wrote:

I have this formula in cell B9
=IF(B10="","",IF(B9="",NOW(),B9))
This puts the current time(remaining static) in B9 anytime something is
entered into B10.
What I would like to do is have one of the command buttons or check boxes in
B10 that would trigger the action.
Thanks for any help.