Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default disabling a cell in excel

How can I disable a cell using VBA in Excel. I want fill in a value in
the cell and then grey it out so that user can just see the value but
cannot edit it.

Your help is much appreciated.
regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default disabling a cell in excel

The simplest way would be to use worksheet protection. If it is the only cell
you want to protect then:

Sub prt()
With ActiveSheet
.Cells.Locked = False
With Range("B4")
.Value = "MyValue"
.Interior.ColorIndex = 15
.Locked = True
End With
.Protect Password:="mypassword"
End With
End Sub

Hope this helps
Rowan

" wrote:

How can I disable a cell using VBA in Excel. I want fill in a value in
the cell and then grey it out so that user can just see the value but
cannot edit it.

Your help is much appreciated.
regards


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default disabling a cell in excel

This is exactly what I wanted.

Thank you very much for taking time to come up with the solution.

regards

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
disabling the copy paste function in a cell sam Excel Worksheet Functions 0 February 22nd 06 02:10 PM
Disabling protected cell selection sneakyzeal Excel Worksheet Functions 1 September 9th 05 05:24 PM
Disabling Cell References camerons New Users to Excel 2 August 27th 05 12:20 AM
Disabling Cell Editing programmingrookie Excel Programming 4 July 26th 05 05:07 PM
Disabling a cell for editing or deleting Tom Ogilvy Excel Programming 0 September 25th 03 04:47 AM


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