Date With VBA
place this in worksheet module
sub worksheet_change(byval target as excel.range)
if target.column < 2 then exit sub
if target = "Sunday" or target = "Saturday" then
with range("a"&trim(str(target.row))+":o"&trim(str(targ et.row)))
interior.colorindex = 15
..locked = true
end with
end if
end sub
this will trigger everytime you type something in column 'b'
--
When you lose your mind, you free your life.
"Danny Jurmann" wrote:
Hi folks,
I am trying to set up something so that if the value in column B is Saturday
or Sunday it formats the row between column A to Column O gray and locked.
Very new to VBA :-)
Thanks,
Danny
|