Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default 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
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
Hide/lock worksheets McChas Excel Worksheet Functions 4 January 7th 10 05:50 PM
Lock Columns and Hide Formula's sparky3883 Excel Worksheet Functions 1 October 14th 05 09:11 PM
hide a column and lock it out Becky Excel Discussion (Misc queries) 2 May 27th 05 05:31 PM
Hide Formula (or Lock Cell) using VBA Aaron5 Excel Programming 2 January 6th 05 02:07 PM
Automatically lock cells and hide formulas Qaspec Excel Programming 4 December 14th 04 11:31 PM


All times are GMT +1. The time now is 08:14 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"