LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
WAP WAP is offline
external usenet poster
 
Posts: 3
Default Easy one: On Open selected cells in a worksheet are disabled.

Hi,
If i want to disable particular cells on a worksheet that
contain values so that they can't be changed when it
opens what is the correct code. i have tried the
following but get error 91 or subscript out of range.

Option Explicit
Dim rng As Range
Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range
Dim xlsheet As Object


Sub auto_open()



Set xlsheet = Worksheets("sheet1")
Set rng = xlsheet.Range("b5")
rng.Enabled = False
Set rng1 = xlsheet.Range("b7:c7")
rng1.Enabled = False
Set rng2 = xlsheet.Range("a11:g23")
rng2.Enabled = False

End Sub

Thanks
WAP
 
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
Protecting selected cells in a worksheet JED Excel Discussion (Misc queries) 5 August 28th 07 09:24 AM
Format drop down option won't open on selected cells Ron West Excel Discussion (Misc queries) 1 October 12th 06 09:36 PM
How do I protect selected cells on my worksheet? Abraz Setting up and Configuration of Excel 1 September 13th 06 12:28 PM
can I print selected cells only within a worksheet martin hanley New Users to Excel 1 January 4th 05 08:07 PM
Open a window / box showing a selected range of cells only jennie Excel Programming 2 April 30th 04 02:32 PM


All times are GMT +1. The time now is 04:17 PM.

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"