Protection for Columns

  • Thread starter Thread starter M-Hero
  • Start date Start date
M

M-Hero

I would like to know how to set protection on specific
columns. I know we can protect Workbook and Worksheet, but
I have no idea how I can protect specific columns. Thank
you.
 
M-Hero said:
I would like to know how to set protection on specific
columns. I know we can protect Workbook and Worksheet, but
I have no idea how I can protect specific columns. Thank
you.

Would you please explain us what you are talking about? Workbook and
Worksheet sounds like Excel terms. Are you using VB.NET (that's what this
group is all about) to control Excel? If not, please turn to an Excel group.
If yes, the question doesn't seem to be specific to VB.NET, it's more a
question on the Excel object model. Please have a look at it first. If
you've got problems creating the VB.NET code to do what you want, feel free
to let us know.
 
Hi Mr Hero,
I would like to know how to set protection on specific
columns. I know we can protect Workbook and Worksheet, but
I have no idea how I can protect specific columns. Thank
you.

I saw this answer in another thread, is this what you mean, I don't know if
it works for you?

To lock specific columns; check this out.

Sub lock_columns()
Cells.Select
Selection.Locked = False
Selection.FormulaHidden = False
Columns("B:C").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Cor
 
* "M-Hero said:
I would like to know how to set protection on specific
columns. I know we can protect Workbook and Worksheet, but
I have no idea how I can protect specific columns. Thank
you.

<
 
Back
Top