Solved

in excel can I "lock" the cell size ?

Posted on 2011-03-21
4
308 Views
Last Modified: 2012-05-11
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.  

0
Comment
Question by:TIMFOX123
  • 2
4 Comments
 

Author Comment

by:TIMFOX123
ID: 35184258
Oh, I forgot  
excel 2k7
I just want to "lock" the hight of the cells
0
 
LVL 6

Accepted Solution

by:
TinTombStone earned 250 total points
ID: 35184414
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
 
LVL 59

Assisted Solution

by:Chris Bottomley
Chris Bottomley earned 250 total points
ID: 35184539
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
 

Author Closing Comment

by:TIMFOX123
ID: 35185831
this will do it.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

This article will show you how to use shortcut menus in the Access run-time environment.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now