Programming dates

T

TB

I have a weekending (Saturday) date in cell G5 programmed as follows:

TheDate = Format(Now + 7 - Weekday(Now), "mm/dd/yy")

The cells in rows B10 through B16 hold numerical data, and correspond to
days of the week (Sunday through Saturday). I need to check for a number > 0
in each cell in the above range, and use the above date to insert both the
date and numerical data elsewhere in the workbook (see pseudocode below).

For Range("B10:B16").Cells
If range("B10").Value > 0 Then
NewDate = range("G5").value - 6 days(Sunday) (need a way to program
this line)
Worksheets("Sheet2").Range("A3").End(xlUp).Offset(1,0).Value = NewDate
Worksheets("Sheet2").Range("B3").End(xlUp).Offset(1,0).Value =
Range("B10").Value
End If
Next

I hope you can understand what I'm trying to do from the above. I can't seem
to find a way to program the date for each day, and when I try to transfer
the data to a new worksheet, I get 1 date from the first number, 2 dates
from the second number, 3 dates from the third, and on and on. Please help!

TB
 

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