#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default Macro - Help

Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 833
Default Macro - Help

To lock all the cells in a Worksheet in EXCEL 2007 take the following action:-

1. Hit Ctrl-1 to launch Format Cells.

2. Protection tab.

3. Remove the green tick from the box called:-

Locked

- then hit OK.

4. Highlight all the cells in your Worksheet by clicking in the box to the
left of A and above 1 in the top left hand corner.

This should cause your Worksheet to become highlighted.

5. Ctrl-1 to launch Format Cells once more.

6. Protection tab.

7. Place a green tick from the box called:-

Locked

- then hit OK.

8. Home / Cells group / Format / Protect Sheet / place a password in the box
called:-

Password to unprotect sheet

(I have used password called test).

At this point there are 3 cells on this window that should have a green tick
in them. They a-

Protect worksheet and contents of locked cells

Select locked cells

Select unlocked cells

After you have entered your password hit OK and then put the password in
again in the box called:-

Reenter password to proceed.

- and then hit OK.

Save the file at this point if required.

9. Close and re-open the file.

Now try to amend any of the cells in the Worksheet and you will not be able
to.

Please hit Yes if my comments have helped.

Thanks!

(I have just run the above procedure and looks OK to me. Let me know if any
probs).


"Jaleel" wrote:

Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default Macro - Help

Hi,

What you suggested is to protect the worksheet. But my idea is not that.
Worksheet must not be protected. But if anything is entered in any of the
cell, that cell must get protected.

Thanks & Regards,

Jaleel

"trip_to_tokyo" wrote:

To lock all the cells in a Worksheet in EXCEL 2007 take the following action:-

1. Hit Ctrl-1 to launch Format Cells.

2. Protection tab.

3. Remove the green tick from the box called:-

Locked

- then hit OK.

4. Highlight all the cells in your Worksheet by clicking in the box to the
left of A and above 1 in the top left hand corner.

This should cause your Worksheet to become highlighted.

5. Ctrl-1 to launch Format Cells once more.

6. Protection tab.

7. Place a green tick from the box called:-

Locked

- then hit OK.

8. Home / Cells group / Format / Protect Sheet / place a password in the box
called:-

Password to unprotect sheet

(I have used password called test).

At this point there are 3 cells on this window that should have a green tick
in them. They a-

Protect worksheet and contents of locked cells

Select locked cells

Select unlocked cells

After you have entered your password hit OK and then put the password in
again in the box called:-

Reenter password to proceed.

- and then hit OK.

Save the file at this point if required.

9. Close and re-open the file.

Now try to amend any of the cells in the Worksheet and you will not be able
to.

Please hit Yes if my comments have helped.

Thanks!

(I have just run the above procedure and looks OK to me. Let me know if any
probs).


"Jaleel" wrote:

Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,494
Default Macro - Help

there are ways around it if people know what they're doing, but you can try
something like this. test it on some test data.

select all of the cells, click format , cells, and uncheck locked on the
protection tab. or select whichever cells you want to work with.

then paste the code on the relevant worksheet's code page in the vb editor.
change the password to whatever you want.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 And Target "" Then
ActiveSheet.Unprotect Password:="123"
Target.Locked = True
ActiveSheet.Protect Password:="123"
End If
End Sub



--


Gary Keramidas
Excel 2003


"Jaleel" wrote in message
...
Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 833
Default Macro - Help

Hi Jaleel, you did say:-

"This is required for the whole worksheet."

However, I shall come back very shortly and show you how to protect just a
few cells.

Please hit Yes if my comments have helped.






"Jaleel" wrote:

Hi,

What you suggested is to protect the worksheet. But my idea is not that.
Worksheet must not be protected. But if anything is entered in any of the
cell, that cell must get protected.

Thanks & Regards,

Jaleel

"trip_to_tokyo" wrote:

To lock all the cells in a Worksheet in EXCEL 2007 take the following action:-

1. Hit Ctrl-1 to launch Format Cells.

2. Protection tab.

3. Remove the green tick from the box called:-

Locked

- then hit OK.

4. Highlight all the cells in your Worksheet by clicking in the box to the
left of A and above 1 in the top left hand corner.

This should cause your Worksheet to become highlighted.

5. Ctrl-1 to launch Format Cells once more.

6. Protection tab.

7. Place a green tick from the box called:-

Locked

- then hit OK.

8. Home / Cells group / Format / Protect Sheet / place a password in the box
called:-

Password to unprotect sheet

(I have used password called test).

At this point there are 3 cells on this window that should have a green tick
in them. They a-

Protect worksheet and contents of locked cells

Select locked cells

Select unlocked cells

After you have entered your password hit OK and then put the password in
again in the box called:-

Reenter password to proceed.

- and then hit OK.

Save the file at this point if required.

9. Close and re-open the file.

Now try to amend any of the cells in the Worksheet and you will not be able
to.

Please hit Yes if my comments have helped.

Thanks!

(I have just run the above procedure and looks OK to me. Let me know if any
probs).


"Jaleel" wrote:

Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 833
Default Protect Specific Range Of Cells Only


Let me assume that I wish to protect the following range of cells D 83 to D
85 (inclusive) in a particular worksheet.

In EXCEL 2007 take the following action:-

1. Highlight all the cells in your Worksheet by clicking in the box to the
left of A and above 1 in the top left hand corner.

This should cause your Worksheet to become highlighted.

2. Hit Ctrl-1 to launch Format Cells.

3. Protection tab.

4. Remove the green tick from the box called:-

Locked

- then hit OK.

5. Highlight cells D 83 to D 85 inclusive in your Worksheet.

This should cause those cells to become highlighted.

6. Ctrl-1 to launch Format Cells once more.

7. Protection tab.

8. Place a green tick from the box called:-

Locked

- then hit OK.

9. Home / Cells group / Format / Protect Sheet / place a password in the box
called:-

Password to unprotect sheet

(I have used password called test).

At this point there are 3 cells on this window that should have a green tick
in them. They a-

Protect worksheet and contents of locked cells

Select locked cells

Select unlocked cells

After you have entered your password hit OK and then put the password in
again in the box called:-

Reenter password to proceed.

- and then hit OK.

Save the file at this point if required.

10. Close and re-open the file.

Now try to amend any of the cells D 83 to D 85 in the Worksheet and you will
not be able to.

11. Now try to amend any other cells (apart from D 83 to D 85) and you will
be able to amend them.

Please hit Yes if my comments have helped.

Thanks!



"Jaleel" wrote:

Hi,

What you suggested is to protect the worksheet. But my idea is not that.
Worksheet must not be protected. But if anything is entered in any of the
cell, that cell must get protected.

Thanks & Regards,

Jaleel

"trip_to_tokyo" wrote:

To lock all the cells in a Worksheet in EXCEL 2007 take the following action:-

1. Hit Ctrl-1 to launch Format Cells.

2. Protection tab.

3. Remove the green tick from the box called:-

Locked

- then hit OK.

4. Highlight all the cells in your Worksheet by clicking in the box to the
left of A and above 1 in the top left hand corner.

This should cause your Worksheet to become highlighted.

5. Ctrl-1 to launch Format Cells once more.

6. Protection tab.

7. Place a green tick from the box called:-

Locked

- then hit OK.

8. Home / Cells group / Format / Protect Sheet / place a password in the box
called:-

Password to unprotect sheet

(I have used password called test).

At this point there are 3 cells on this window that should have a green tick
in them. They a-

Protect worksheet and contents of locked cells

Select locked cells

Select unlocked cells

After you have entered your password hit OK and then put the password in
again in the box called:-

Reenter password to proceed.

- and then hit OK.

Save the file at this point if required.

9. Close and re-open the file.

Now try to amend any of the cells in the Worksheet and you will not be able
to.

Please hit Yes if my comments have helped.

Thanks!

(I have just run the above procedure and looks OK to me. Let me know if any
probs).


"Jaleel" wrote:

Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default Macro - Help

Gary,

Thank you very much. This is exactly what I wanted.

Cheers,

Jaleel

"Gary Keramidas" wrote:

there are ways around it if people know what they're doing, but you can try
something like this. test it on some test data.

select all of the cells, click format , cells, and uncheck locked on the
protection tab. or select whichever cells you want to work with.

then paste the code on the relevant worksheet's code page in the vb editor.
change the password to whatever you want.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 And Target "" Then
ActiveSheet.Unprotect Password:="123"
Target.Locked = True
ActiveSheet.Protect Password:="123"
End If
End Sub



--


Gary Keramidas
Excel 2003


"Jaleel" wrote in message
...
Hi,

I don't know whether it is possible. Still I am asking the experts. My
requirement is this.

In a blank worksheet, if anything is typed in a cell, it must become like
protected. Means it cannot be deleted or edited or retyped. This is
required for the whole worksheet.

Can anybody help?

Thanks & Regards,

Jaleel


.

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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM


All times are GMT +1. The time now is 08:26 PM.

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"