Solved

in excel can I "lock" the cell size ?

Posted on 2011-03-21
4
310 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

777 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