Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding A Date Command Button


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

--
haze
-----------------------------------------------------------------------
hazey's Profile: http://www.excelforum.com/member.php...fo&userid=2956
View this thread: http://www.excelforum.com/showthread.php?threadid=49263

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding A Date Command Button


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


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=492633

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding A Date Command Button


Awesome, thanks a lot you guys! Works perfectly!


--
hazey
------------------------------------------------------------------------
hazey's Profile: http://www.excelforum.com/member.php...o&userid=29561
View this thread: http://www.excelforum.com/showthread...hreadid=492633

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Adding A Date Command Button

You're welcome.

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i use a command button to validate date and time kcdonaldson Excel Discussion (Misc queries) 0 December 9th 05 04:03 PM
adding a command button to an excel cell? betelguese Excel Discussion (Misc queries) 1 March 22nd 05 03:09 AM
Adding Code to an Existing Command Button with VBA jasoncw[_2_] Excel Programming 1 February 15th 05 11:15 PM
Adding a control button to insert a date in the active cell. Mike Excel Discussion (Misc queries) 2 February 15th 05 06:27 PM
Adding a command button Roy Thompson Excel Programming 2 October 4th 04 10:12 PM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"