Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub copytodayscolumn()
'set a1 If Weekday(Date) = 1 Then x = 0 If Weekday(Date) = 2 Then x = -1 If Weekday(Date) = 3 Then x = 8 - Weekday(Date) Range("a1") = Date + x mc = Rows(1).Find(Date, LookIn:=xlFormulas).Column 'MsgBox mc lr = Cells(Rows.Count, mc).End(xlUp).Row 'MsgBox lr 'Range(Cells(2, mc), Cells(lr, mc)).Copy Range("z1") Range(Cells(2, "e"), Cells(lr, "e")).Value = _ Range(Cells(2, mc), Cells(lr, mc)).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Sean" wrote in message ... My date in A1 is also derived from a formula =TODAY() +IF(WEEKDAY(TODAY())=1,0,IF(WEEKDAY(TODAY())=2,-1,8-WEEKDAY(TODAY()))) Hence I get a debug error of 'Object variable or With block variable not set' if I hard code the dates, code works fine, is there a way to overcme this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
is there a formula that will subtract todays date from a hire date | Excel Worksheet Functions | |||
How do I subtract todays date from range of dates | Excel Worksheet Functions | |||
Exel increment date problem wrt todays date. | Excel Worksheet Functions | |||
Create a button that will date stamp todays date in a cell | Excel Discussion (Misc queries) | |||
When I open my past invoice it keeps changing date to todays date | Excel Worksheet Functions |