Locking Cells in Excel

  • Thread starter Thread starter Ed Dobias
  • Start date Start date
E

Ed Dobias

Good Morning

I am working in V/B 6 with a program I wrote to query a database an
write the results to an Excel template. After, all the writing i
done, I want to lock all the cells except for column 3 so the end use
does not change anything he/she is not suppose to.

How can I do this in V/B code
 
Have you tried recording a macro while you do it? A good way to learn

Range("G1:G5").Locked = False
or
columns("c").locked=false
boiled down from macro below
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/26/2004 by Don Guillett
'

'
Range("F1:F5").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("G1:G5").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("H19").Select
End Sub
 
Back
Top