LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Function/Sub to change cell properties

I have a code snippet that I am using to change the properties of a cell:

With Range("FirstSlaveCell")
.Interior.Pattern = xlGray50
.Locked = True
.FormulaHidden = False
.Validation.InCellDropdown = False
End With

I want to replace it with a function/sub that looks like the one below but I
am getting a Run Time Error 424 Object Required. What am I doing wrong?

DisableCell (Range("FirstSlaveCell"))

Sub DisableCell(rng As Range)
With rng
.Interior.Pattern = xlGray50
.Locked = True
.FormulaHidden = False
.Validation.InCellDropdown = False
End With
End Sub

 
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
how to change multiple cell comment properties? numbersjim Excel Discussion (Misc queries) 1 February 25th 10 07:44 PM
change control properties according to a cell value Billums Excel Worksheet Functions 1 March 23rd 06 11:15 AM
Change Cell properties by Function Gilles P (FR) Excel Worksheet Functions 2 January 31st 06 12:26 PM
VBA: how to... cell properties has to change based on a condition will99 Excel Programming 3 August 30th 05 05:51 PM
Change the properties of a non selected cell? Winshent Excel Programming 2 September 23rd 04 01:48 PM


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

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

About Us

"It's about Microsoft Excel"