ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Lock Columns (https://www.excelbanter.com/excel-programming/368265-vba-lock-columns.html)

DukeDevil

VBA Lock Columns
 
Hello,

I want to permanently lock columns S:W on my sheet using VBA. I do NOT
want to write a macro. I need it in the following format. Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)

(code)

End Sub


Tom Ogilvy

VBA Lock Columns
 
You say you don't want to write a macro, then show a macro declaration for
the change event. Also, you say permanently - so why do you want it in the
change event (a macro).

Mark all the cells in that range as locked, then protect the sheet with a
password.

--
Regards,
Tom Ogilvy


"DukeDevil" wrote:

Hello,

I want to permanently lock columns S:W on my sheet using VBA. I do NOT
want to write a macro. I need it in the following format. Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)

(code)

End Sub



Otto Moehrbach

VBA Lock Columns
 
What you say is nonsensical. You want to do it using VBA but NOT using a
macro. You can't use VBA without writing a macro (or UDF). Also the format
you give is a macro in itself. You say you want to "lock columns S:W".
Exactly what do you want to do? In other words, what does "lock columns"
mean to you? HTH Otto
"DukeDevil" wrote in message
ps.com...
Hello,

I want to permanently lock columns S:W on my sheet using VBA. I do NOT
want to write a macro. I need it in the following format. Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)

(code)

End Sub





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com