Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default Locking specific cells

HI
i posted a query already - please ignore that.

In a data entry sheet
column b has dates and B3 has specific date
i like to lock adjacent cells in columns F,G & H
if the date in column B is not date in B3 (criteria)
further should not allow to delete anyrow when there is value in cells of
F,G & H columns. if there is no value then those can be deleted.

sub Worksheet_Change(ByVal Target As Range)

if cell(b column) = $B$3 then
activesheet.unprotect ="hi"
cell.("F"&row).locked = false
cell.("G"&row).locked = false
cell.("h"&row).locked = false

else
activesheet.unprotect ="hi"
cell.("F"&row).locked = true
cell.("G"&row).locked = true
cell.("h"&row).locked = true
endif

activesheet.protect ="hi"

end sub






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Locking specific cells

Did I fix this issue for you in your other post titled "CAN WE LOCK CELLS AT
F COLUMN BASED ON VALUE AT C COLUMN" or is this a new issue?

--
Cheers,
Ryan


"Eddy Stan" wrote:

HI
i posted a query already - please ignore that.

In a data entry sheet
column b has dates and B3 has specific date
i like to lock adjacent cells in columns F,G & H
if the date in column B is not date in B3 (criteria)
further should not allow to delete anyrow when there is value in cells of
F,G & H columns. if there is no value then those can be deleted.

sub Worksheet_Change(ByVal Target As Range)

if cell(b column) = $B$3 then
activesheet.unprotect ="hi"
cell.("F"&row).locked = false
cell.("G"&row).locked = false
cell.("h"&row).locked = false

else
activesheet.unprotect ="hi"
cell.("F"&row).locked = true
cell.("G"&row).locked = true
cell.("h"&row).locked = true
endif

activesheet.protect ="hi"

end sub






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
locking cells from specific point to infinity Ken[_27_] Excel Programming 8 September 13th 09 05:14 AM
trouble locking specific cells [email protected] Excel Worksheet Functions 2 June 19th 07 05:14 PM
Locking specific cells in a workbook Sarah Excel Discussion (Misc queries) 2 April 17th 07 03:16 AM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM
Locking Specific Cells [email protected][_2_] Excel Programming 3 March 1st 06 04:16 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"