Consulting

Results 1 to 2 of 2

Thread: how to autoadjust the size of a cell in a worksheet?

  1. #1

    how to autoadjust the size of a cell in a worksheet?

    I wrote some codes to fill the cells of a worksheet, I want to know how can I adjust the size of the cell with the size of the text inside it?

  2. #2
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    example [VBA]
    Option Explicit

    Sub Adjust()
    Sheet1.Columns.AutoFit
    End Sub
    [/VBA]
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •