View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CJ-22 CJ-22 is offline
external usenet poster
 
Posts: 1
Default If/Then/Else formulas in macros


I am new to VB/macros but want to know if this is possible. I have
created a workbook to quickly and easily record times for runners. I
have assigned a macro to a button titled "start" which inserts the
current time in cell A1. Then I have created several numbered buttons
that put the current time next to a runners name. A formula subtracts
the difference to get the time.

What I now want to do is be able to get a split time by pressing the
button for a second time. What I need the macro to do is on the first
press of a button put the current time in cell A3, on the second press
of the same button place the current time in cell B3, and on the third
press of the same button place the current time in cell C3. Is this
possible and how, or is there a better way to accomplish this?

Here is the current macro I recorded.

Sub Finish_01()
'
' Finish_01 Macro
' Macro recorded 10/11/2005 by CJ_22
'

'
Range("F5").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
End Sub

Thanks for any reply.


--
CJ-22
------------------------------------------------------------------------
CJ-22's Profile: http://www.excelforum.com/member.php...o&userid=17551
View this thread: http://www.excelforum.com/showthread...hreadid=503191