• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

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.  

  • 2
2 Solutions
TIMFOX123Author Commented:
Oh, I forgot  
excel 2k7
I just want to "lock" the hight of the cells
I dont know if there is a direct way of stopping the row height being changed, but this



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

Chris BottomleyCommented:
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.

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

Open in new window

TIMFOX123Author Commented:
this will do it.
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.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now