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

I want a marco to run before the workbook save:
The macro must check in every sheet the cells I1 to I50
and if there is a value inside the checked cell , it must lock
the row .

Example if it finds a word at cell I38 i want the macro to lock Row(38).
Please help me


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default lock cells after save


Here is the code:-

Sub LockEmpty()
For Each s In ThisWorkbook.Sheets
For Each c In s.Range("I1:I50")
If Not IsEmpty(c) Then
c.EntireRow.Locked = True
End If
Next c
Next s
End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Losing hyperlinks, lock Save As so it cannot be saved in a lower format Hedstrom Excel Discussion (Misc queries) 0 July 26th 10 10:22 PM
lock used cells MIke Excel Discussion (Misc queries) 6 October 20th 07 12:20 AM
can I lock a spreadsheet so if any changes are made must be save with new name? Brad New Users to Excel 4 May 16th 07 10:26 PM
why do some cells not lock? CDecuir Excel Discussion (Misc queries) 1 April 16th 07 08:31 PM
how do i lock a cell? to save formula or function in it? Ajay Upmaneu Excel Discussion (Misc queries) 1 July 4th 06 10:17 AM


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

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

About Us

"It's about Microsoft Excel"