Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
Hello,
I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
Not in the same sense as a row or a column. You can hide the formula in a
cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
Individual cells can be locked though.
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tom Ogilvy" wrote in message ... Not in the same sense as a row or a column. You can hide the formula in a cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
Yes, guess I focused on the "Hide" portion and ignored the "Lock" portion.
-- Regards, Tom Ogilvy "Bob Phillips" wrote: Individual cells can be locked though. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tom Ogilvy" wrote in message ... Not in the same sense as a row or a column. You can hide the formula in a cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
so I can do something like this:
--------- Cells(x,y).select selection.FormulaHidden = True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ------------- Is this the code to lock cells: cells(x,y).Locked = True -------------- Another related question. For the code below Columns("AT:IV").Hidden = True '??How can I use numbers for columns instead of AT and IV? do I need to use cells. Rows("44:65536").Hidden = True ' I used a variable row= 1, col = 44 and when I tried: Rows("row:col"), this would not work. Do you have any input on this Thanks for your help "Tom Ogilvy" wrote: Yes, guess I focused on the "Hide" portion and ignored the "Lock" portion. -- Regards, Tom Ogilvy "Bob Phillips" wrote: Individual cells can be locked though. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tom Ogilvy" wrote in message ... Not in the same sense as a row or a column. You can hide the formula in a cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
With Cells(x,y)
.FormulaHidden = True .Locked = True End with ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True columns(46).Resize(,256-46+1) testing in the immediate window (to demonstrate) ? columns(46).Resize(,256-46+1).address $AT:$IV or Cells(1,46).Resize(1,256-46+1).EntireColumn I would avoid useing terms used by excel, such as "row" which is a propertie name. Range(rw & ":" & col) Testing in the immediate window: (to demonstrate) rw = 44 col = 65536 ? Range(rw & ":" & col).Address $44:$65536 -- Regards, Tom Ogilvy "David" wrote: so I can do something like this: --------- Cells(x,y).select selection.FormulaHidden = True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ------------- Is this the code to lock cells: cells(x,y).Locked = True -------------- Another related question. For the code below Columns("AT:IV").Hidden = True '??How can I use numbers for columns instead of AT and IV? do I need to use cells. Rows("44:65536").Hidden = True ' I used a variable row= 1, col = 44 and when I tried: Rows("row:col"), this would not work. Do you have any input on this Thanks for your help "Tom Ogilvy" wrote: Yes, guess I focused on the "Hide" portion and ignored the "Lock" portion. -- Regards, Tom Ogilvy "Bob Phillips" wrote: Individual cells can be locked though. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tom Ogilvy" wrote in message ... Not in the same sense as a row or a column. You can hide the formula in a cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
Thanks Tom,
I will give this a try. Apprreciate your help "Tom Ogilvy" wrote: With Cells(x,y) .FormulaHidden = True .Locked = True End with ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True columns(46).Resize(,256-46+1) testing in the immediate window (to demonstrate) ? columns(46).Resize(,256-46+1).address $AT:$IV or Cells(1,46).Resize(1,256-46+1).EntireColumn I would avoid useing terms used by excel, such as "row" which is a propertie name. Range(rw & ":" & col) Testing in the immediate window: (to demonstrate) rw = 44 col = 65536 ? Range(rw & ":" & col).Address $44:$65536 -- Regards, Tom Ogilvy "David" wrote: so I can do something like this: --------- Cells(x,y).select selection.FormulaHidden = True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ------------- Is this the code to lock cells: cells(x,y).Locked = True -------------- Another related question. For the code below Columns("AT:IV").Hidden = True '??How can I use numbers for columns instead of AT and IV? do I need to use cells. Rows("44:65536").Hidden = True ' I used a variable row= 1, col = 44 and when I tried: Rows("row:col"), this would not work. Do you have any input on this Thanks for your help "Tom Ogilvy" wrote: Yes, guess I focused on the "Hide" portion and ignored the "Lock" portion. -- Regards, Tom Ogilvy "Bob Phillips" wrote: Individual cells can be locked though. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tom Ogilvy" wrote in message ... Not in the same sense as a row or a column. You can hide the formula in a cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide/lock cells?
Hi tom, sorry I am little bit new to excel/VB
I understand the following code: ------- With Cells(x,y) .FormulaHidden = True .Locked = True End with ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ------------------ Can you please explain what is this other code doing Is the "?" included in the code --------------------------- rw = 44 col = 65536 ? Range(rw & ":" & col).Address $44:$65536 ------------------------------- Is the code below changing the size of specific cells? Cells(1,46).Resize(1,256-46+1).EntireColumn "256-46+1" ?? Thanks for your help "David" wrote: Thanks Tom, I will give this a try. Apprreciate your help "Tom Ogilvy" wrote: With Cells(x,y) .FormulaHidden = True .Locked = True End with ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True columns(46).Resize(,256-46+1) testing in the immediate window (to demonstrate) ? columns(46).Resize(,256-46+1).address $AT:$IV or Cells(1,46).Resize(1,256-46+1).EntireColumn I would avoid useing terms used by excel, such as "row" which is a propertie name. Range(rw & ":" & col) Testing in the immediate window: (to demonstrate) rw = 44 col = 65536 ? Range(rw & ":" & col).Address $44:$65536 -- Regards, Tom Ogilvy "David" wrote: so I can do something like this: --------- Cells(x,y).select selection.FormulaHidden = True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ------------- Is this the code to lock cells: cells(x,y).Locked = True -------------- Another related question. For the code below Columns("AT:IV").Hidden = True '??How can I use numbers for columns instead of AT and IV? do I need to use cells. Rows("44:65536").Hidden = True ' I used a variable row= 1, col = 44 and when I tried: Rows("row:col"), this would not work. Do you have any input on this Thanks for your help "Tom Ogilvy" wrote: Yes, guess I focused on the "Hide" portion and ignored the "Lock" portion. -- Regards, Tom Ogilvy "Bob Phillips" wrote: Individual cells can be locked though. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tom Ogilvy" wrote in message ... Not in the same sense as a row or a column. You can hide the formula in a cell by using Selection.FormulaHidden = True but the value it calculates will be displayed. You set this property of the range as shown, then you must protect the sheet. Otherwise, hide the entirerow or column. -- Regards, Tom Ogilvy "David" wrote: Hello, I know that range of rows or columns can be hidden or locked. How about specific cells? what is the syntax for that. Thanks for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide/lock worksheets | Excel Worksheet Functions | |||
Lock Columns and Hide Formula's | Excel Worksheet Functions | |||
hide a column and lock it out | Excel Discussion (Misc queries) | |||
Hide Formula (or Lock Cell) using VBA | Excel Programming | |||
Automatically lock cells and hide formulas | Excel Programming |