in excel can I "lock" the cell size ?

I am using a automatic script to move my mouse and click on stuff.

I need my excel cells to stay the same hight regardless of what stupid stuff I do to my spreadsheet.  

TIMFOX123Asked:
Who is Participating?
 
TinTombStoneCommented:
I dont know if there is a direct way of stopping the row height being changed, but this

Sheets("Sheet1").Rows.AutoFit

or

Sheets("Sheet1").Rows.RowHeight = 15

dropped into one of the worksheet or workbook events, perhaps Worksheet_Activate

will quickly resize them

Or you  could hide the row and column header completely, which makes it quite hard to resize them

    ActiveWindow.DisplayHeadings = False

0
 
TIMFOX123Author Commented:
Oh, I forgot  
excel 2k7
I just want to "lock" the hight of the cells
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Lock it ... not particularly well but with some VBA we can force it back!

The change event handler for the sheet as below resets the row to a fixed value ... 22.5 for example with every change.

As you can see it is applied to row 6 but this is adaptable as required.

Chris
Private Sub Worksheet_Change(ByVal Target As Range)
    Me.Rows(6).RowHeight = 22.5
End Sub

Open in new window

0
 
TIMFOX123Author Commented:
this will do it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.