Adding A Date Command Button

  • Thread starter Thread starter hazey
  • Start date Start date
H

hazey

Hey there. Here is what I would like to do. I am using Excel 2000.
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 rathe
simple for you guys, but I really have no clue and it would be a hug
help for me if you could send me the code. Thanks so much in advance
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top