ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date With VBA (https://www.excelbanter.com/excel-programming/335094-date-vba.html)

Danny Jurmann

Date With VBA
 
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



ben

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





All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com