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
|