Results 1 to 5 of 5

Macro doesn't place results where I want them

Threaded View

  1. #1
    Registered User
    Join Date
    09-22-2008
    Location
    markham
    Posts
    52

    Macro doesn't place results where I want them

    Hello,

    I'm a macro newbie and have simply copied this macro to accomplish the task of timing the completion of an excel test.

    I would like the start time and stop time to appear at the top of a data range in cell A1 and B1 respectively. Using the code below, the start and stop times appear at the end of the data range (in column A and B).

    How can I fix this macro to accomplish my objective?

    Thank you.

    Brandy


    Private Sub CommandButton1_Click()
    lngCol = IIf(CommandButton1.Caption = "Stop", 2, 1)
    lngRow = ActiveSheet.Cells(Rows.Count, lngCol).End(xlUp).Row + 1
    Cells(lngRow, lngCol) = Now()
    CommandButton1.Caption = IIf(CommandButton1.Caption = "Stop", "Start", "Stop")
    End Sub
    Sorry about not posting my code correctly. It's my first time.

    Thanks for your patience and assistance.

    That worked perfectly! Thank you very much!
    Last edited by Brandy; 05-17-2011 at 03:37 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1