View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PhilB[_2_] PhilB[_2_] is offline
external usenet poster
 
Posts: 1
Default Trying to increment by one day in a macro


Hello,
Having all sorts of fun getting this one worked out, to date, n
success at all
I basically one to have a form to collect the start date and nr of day
required then print the worksheet with the dates incrementing from th
start date by one for the number of days required.
This is what I have tried:

Private Sub cmdPrint_Click()
'Dim Variables
Dim D As Integer
Sheets("LogSheet").Select
Range("Date") = ""
'Transfer Info from frmDriverLogInfo
Sheets("LogSheet").Select
Range("Date") = txtStartDate.Value
D = cboNrOfDays.Value
'Print Selected Number of Days
For I = 1 To D
Sheets("LogSheet").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.Range("Date").Value = ActiveSheet.Range("Date").Value
1
Next I
End Sub

Any help would be most appreciated.
Many thanks, Phi

--
Phil
-----------------------------------------------------------------------
PhilB's Profile: http://www.excelforum.com/member.php...fo&userid=1286
View this thread: http://www.excelforum.com/showthread.php?threadid=31897