Announcement

Collapse
No announcement yet.

automatic cell resize

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • automatic cell resize



    In my excel spreadsheet, i type a lot of information into individual cells. Most of the time this information carys on to anonther line and i have to resize the cell by hand if i want the information to print. With about 10-20 lines to resize in a report at a rate of 50 reports a day, resizing these cells can be pesky and time consuming. How can i create a macro to resize these cells automatically? Please help.

  • #2
    Re: automatic cell resize

    How do you want to resize them?

    Entirecolumn.autofit?

    Entirerow.autofit?

    Do you want to wrap the text etc. etc.

    Do you have a sample of before and after as this will ensure you get the required response
    ________________________________________

    Good Luck!

    Ray

    Comment


    • #3
      Re: automatic cell resize

      I wrap the text and i want to resize the entire row. I have tried the autofit and it doesnt fit to the depth of the line. It actually shrinks the row to contain only one line. Thank You!

      Comment


      • #4
        Re: automatic cell resize

        Do you have a specific height or width you would like?

        How many columns are you using?

        You could do something like this

        Code:
        With Cells
            .WrapText = True
            .EntireColumn.AutoFit
            .EntireRow.AutoFit
        End With
        It may work better if you set a column width e.g columnwidth = 20
        Last edited by REP013; November 18th, 2004, 01:39. Reason: extra info
        ________________________________________

        Good Luck!

        Ray

        Comment


        • #5
          Re: automatic cell resize

          Hi,

          Just a general query, if a cell is formatted as containing wrapped text, at what width do you expect excel it to autosize to? It seems when I try it, an arbitrary value is used therefore using an auto function might not be your solution.

          John

          Comment


          • #6
            Re: automatic cell resize

            John, a valid point, it seems to have no "set" value, that is why I added a line after my post re setting a column width, this should then fulfill the requirements?
            ________________________________________

            Good Luck!

            Ray

            Comment


            • #7
              Re: automatic cell resize

              I Just tried the auto fit column and row macro, and it still doesnt auto fit. I have multiple columns merged in specific rows if that makes a difference. Instead of auto fitting, it just shrinks it down to showing only one line of text.

              Comment


              • #8
                Re: automatic cell resize

                this is an example of what i am trying to do.
                Attached Files

                Comment


                • #9


                  Re: automatic cell resize

                  Merged cells can pose all kinds of problems (this is one area). This is one reason that 99.99% of the time I will never use merged cells in a spreasheet solution (unless it is for the last step for presentation - and even then I will use Center across selection).

                  Software: OpenOffice 3.0/NeoOffice 3.0 on Mac OS X 10.5.6
                  Humanware: Older than dirt

                  Old, slow, and confused - but at least I'm inconsistent!

                  Rich
                  (retired Excel 2003 user, 3.28.2008)

                  Comment

                  Working...
                  X