Excel VBA highlight entire column according to today's date -


i have following data in excel table. requirements highlight the entire column of current date.

my excel table

have found code search through dates , select today's date. when try move cell input data, keeps on going selected date , unable key in. below code.

private sub worksheet_selectionchange(byval target range)        dim todaysdate date   dim rng range    todaysdate = clng(date)   rows("1:1")   set rng = .find(what:=todaysdate, _   after:=.cells(.cells.count), _   lookin:=xlformulas, _   lookat:=xlwhole, _   searchorder:=xlbyrows, _   searchdirection:=xlnext, matchcase:=false)  if not rng nothing  application.goto rng, true else  'give message today's date not found    msgbox "nothing found" end if end with` 


above code doesn't include highlighting part yet since have no idea how since learn vba since yesterday.
appreciated.

to use vba:

private sub worksheet_selectionchange(byval target range)   dim todaysdate date   dim rng range    todaysdate = clng(date)   rows("1:1")   set rng = .find(what:=todaysdate, _   after:=.cells(.cells.count), _   lookin:=xlformulas, _   lookat:=xlwhole, _   searchorder:=xlbyrows, _   searchdirection:=xlnext, matchcase:=false) if not rng nothing rng.entirecolumn.interior.color = vbmagenta else  'give message today's date not found    msgbox "nothing found" end if end end sub 

Comments