ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do you change a row height in a protected worksheet (https://www.excelbanter.com/excel-programming/305621-how-do-you-change-row-height-protected-worksheet.html)

Vince[_5_]

how do you change a row height in a protected worksheet
 
I have written a program and I want the end user to be
able to change certain row heights and certain column
widths.
My VB program works fine untill I protect the work sheet.
Is there any way that I can change some of the row heights
and column widths via the program without having to unlock
the worksheet
Thanks
Vince

Norman Jones

how do you change a row height in a protected worksheet
 
Hi Vince,

If you protect your sheet in code, setting the UserInterfaceOnly argument
to true, you will be able to manipulate the row heights in your code.

Note, however, that the value of this argument is not persistant and, on
re-opening the workbook, the sheet will be protected with the default
(false) value set for this argument.

A solution to this is to protect the worksheet when the workbook is opened,
for example:

Sub Auto_Open
Dim WS As Worksheet

Set WS = Worksheets("Sheet1")

WS.Protect Password:="hi", userinterfaceonly:=True
End Sub

---
Regards,
Norman

"Vince" wrote in message
...
I have written a program and I want the end user to be
able to change certain row heights and certain column
widths.
My VB program works fine untill I protect the work sheet.
Is there any way that I can change some of the row heights
and column widths via the program without having to unlock
the worksheet
Thanks
Vince




Norman Jones

how do you change a row height in a protected worksheet
 
Hi Vince,

I omitted to add:

Alternatively,In your code you can unprotect, adjust your row heights and
then re-protect your sheet.

---
Regards
Norman



"Vince" wrote in message
...
I have written a program and I want the end user to be
able to change certain row heights and certain column
widths.
My VB program works fine untill I protect the work sheet.
Is there any way that I can change some of the row heights
and column widths via the program without having to unlock
the worksheet
Thanks
Vince




No Name

how do you change a row height in a protected worksheet
 
Thank you Norman
I like this method better as it will give the operator to
adjust the rows that I will allow within the program.

Vince



-----Original Message-----
Hi Vince,

I omitted to add:

Alternatively,In your code you can unprotect, adjust your

row heights and
then re-protect your sheet.

---
Regards
Norman



"Vince" wrote in

message
...
I have written a program and I want the end user to be
able to change certain row heights and certain column
widths.
My VB program works fine untill I protect the work

sheet.
Is there any way that I can change some of the row

heights
and column widths via the program without having to

unlock
the worksheet
Thanks
Vince



.



All times are GMT +1. The time now is 10:56 AM.

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