LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Help needed with the list of the trading days between start/endDat

Here is the excel ws and the code follows.

1/1/2005 start date 1/1/2005
end date 2/2/2006

This code is supposed to copy the start date, then extract the next trading
days date from DVS referencing the start date through the formula, and do so
until the trading day date = end date. When it's more than that it should
erase the date. So the result should be a list of trading days between and
including the start and end dates.

However, my code only puts a counter from 2 to 20 - how to you make it from
2 to infinity though? Then when i execute this code, it only copies the start
date and doesn't do anything beyond that. Could you guys help me pls?

Thanks.

Sub click()

Dim counter As Integer
Dim curCell As Date
Dim startDate As Date
Dim endDate As Date

startDate = Range("e1").Value
endDate = Range("e2").Value

Range("C1").Select
ActiveCell.FormulaR1C1 = startDate

For counter = 2 To 20
curCell = Worksheets("sheet3").Cells(counter, 3).FormulaR1C1 =
"=dvshandelsdatum(R[-1]C,1)"

If curCell endDate Then Cells(counter, 3) = ""
Next counter

End Sub
 
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
Display the days between start & end date columns Pat Briggs Excel Discussion (Misc queries) 3 May 18th 10 05:45 PM
AFTER ARRIVAL FROM 5TH DAYS TO START CHARGES [email protected] Excel Worksheet Functions 4 November 8th 07 04:26 AM
HOW DO I SET UP A COUNTDOWN OF DAYS LEFT FROM START TO FINISH. Tommy Setting up and Configuration of Excel 1 January 11th 07 06:37 AM
stock chart -- how to include only trading days Jordan Burkart Charts and Charting in Excel 2 August 6th 05 05:28 AM
VBA Code needed to start different public sub mbergman Excel Programming 0 February 5th 04 01:41 PM


All times are GMT +1. The time now is 09:59 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"