+ Reply to Thread
Results 1 to 5 of 5

Adding A Date Command Button

  1. #1
    Registered User
    Join Date
    12-12-2005
    Posts
    2

    Adding A Date Command Button

    Hey there. Here is what I would like to do. I am using Excel 2000. I would like to add a command button to my Excel form that, when pressed, will add 56 days to a cell on my spread sheet. I'm sure this is rather simple for you guys, but I really have no clue and it would be a huge help for me if you could send me the code. Thanks so much in advance.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Hazy,

    Here is a code example using A1 as the cell with the date of Oct, 15 2005. The result of adding 56 days will yield Dec 10, 2005.

    Code Example:

    With Worksheets("Sheet1")
    .Range("A1").Value = .Range("A1").Value + 56
    End With

    Sincerely,
    Leith Ross

  3. #3
    Rowan Drummond
    Guest

    Re: Adding A Date Command Button

    Try:

    Private Sub cmdAddDays_Click()
    With Sheets("Sheet1").Range("A1")
    If IsDate(.Value) Then
    .Value = .Value + 56
    End If
    End With
    End Sub

    Hope this helps
    Rowan

    hazey wrote:
    > Hey there. Here is what I would like to do. I am using Excel 2000. I
    > would like to add a command button to my Excel form that, when pressed,
    > will add 56 days to a cell on my spread sheet. I'm sure this is rather
    > simple for you guys, but I really have no clue and it would be a huge
    > help for me if you could send me the code. Thanks so much in advance.
    >
    >


  4. #4
    Registered User
    Join Date
    12-12-2005
    Posts
    2

    Thanks

    Awesome, thanks a lot you guys! Works perfectly!

  5. #5
    Rowan Drummond
    Guest

    Re: Adding A Date Command Button

    You're welcome.

    hazey wrote:
    > Awesome, thanks a lot you guys! Works perfectly!
    >
    >


+ 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