Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming dates
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programming | Excel Discussion (Misc queries) | |||
vba programming | Excel Discussion (Misc queries) | |||
programming help | Excel Discussion (Misc queries) | |||
CD Programming | Excel Discussion (Misc queries) | |||
programming | Excel Discussion (Misc queries) |