+ Reply to Thread
Results 1 to 2 of 2

using pushbottons to put date and time in cells

Hybrid View

nathanv3223 using pushbottons to put date... 05-23-2008, 11:28 AM
Simon Lloyd I think this is what you... 05-24-2008, 11:30 AM
  1. #1
    Registered User
    Join Date
    05-16-2008
    Posts
    23

    using pushbottons to put date and time in cells

    Hi again everyone I have been trying to modify 2 macros that I have. The ones that I have are not seeming to work. Can anyone help me please.

    What I'm trying to do is use two push buttons a stop and start button. But I don't need it to add dates and time to further cells. I just need dates and times to b and c cells, b1 and c1. Then another set that would go to b2 and c2 and so on probably for about 20 rows does this make sense. I have attached a sheet showing what I am trying to do. can anyone help please.
    Attached Files Attached Files

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    I think this is what you want, replace the code you have for your buttons with the following:

    Private Sub CommandButton1_Click()
        Range("D" & Rows.Count).End(xlUp).Offset(1, 0).Value = "=NOW()"
    End Sub
    
    Private Sub start_Click()
         Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Value = "=NOW()"
    End Sub
    now every time you click one of the buttons it will put the time and date in the next available cell in the column.
    Not all forums are the same - seek and you shall find

+ Reply to Thread

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