Auto-populate cells based on dates

F

Freddy

Microsoft Visual Basic 6.5 on Microsoft Excel 2002 SP3. I'd like assistance
in writing VBA code to evaluate a column of dates then copy them to a
different cell depending on the date thereby sorting them to eventually
determine which slots remain to be filled.
 
B

Bob Bridges

Hi, Freddy. What criteria will you use for placing the dates in their new
location? Is it simply a serial decision (eg Jan 1 will go in row 2, Jan 5
in row 6 and Feb 2 in row 34)? If so, this sounds pretty simple, but I need
some decision to be sure.

On the assumption that you already know some VBA, here's a bit of (untested)
code that could work along the above lines:

LowestDate = CDate("2008-06-01") 'for example
For Each co In FromDateRange
If IsDate(co.Value) Then 'ignore non-date values
ToRow = CDate(co.Value) - LowestDate + 2
ToSheet.Cells(ToRow, 1) = co.Value
End If
Next co
 

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

Top