+ Reply to Thread
Results 1 to 3 of 3

Increment Date by 1

Hybrid View

evenings Increment Date by 1 06-03-2010, 10:02 AM
ShredDude Re: Increment Date by 1 06-03-2010, 10:09 AM
evenings Re: Increment Date by 1 06-03-2010, 10:22 AM
  1. #1
    Registered User
    Join Date
    04-20-2008
    Location
    New York City
    MS-Off Ver
    2003
    Posts
    38

    Increment Date by 1

    I have a date on cell K1. I have several macro buttons throughout the spreadsheet. I want the date on cell K1 to increment to the next date when any of the buttons are pressed.

    I thought this would work.
    Sub addOne()
        Range ("K1") + 1
    End Sub
    The macro buttons work just fine. I just want to add this ability by calling addOne() whenever I press any of the buttons.

  2. #2
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: Increment Date by 1

    In each Command Button's event code, place the call to addone in the Click event

    Private Sub CommandButton1_Click()
     Call addOne
    End Sub
    Your addOne procedure should probably be:

    Sub addOne()
       Range("k1")=  Range ("K1") + 1
    End Sub
    Last edited by ShredDude; 06-03-2010 at 10:12 AM.

  3. #3
    Registered User
    Join Date
    04-20-2008
    Location
    New York City
    MS-Off Ver
    2003
    Posts
    38

    Re: Increment Date by 1

    Quote Originally Posted by ShredDude View Post

    Your addOne procedure should probably be:

    Sub addOne()
       Range("k1")=  Range ("K1") + 1
    End Sub
    That worked thanks.

+ 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