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?