Results 1 to 3 of 3

Thread: Excel and cell formating from vb

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178

    Post

    Two questions.

    1. How do you increase the width of an excel column to match the length of the longest piece of data put into it. Have tried using len from within vb but this still doesn't seem to increase the width to the widest required.

    2. How do you insert a heading into Row 0, and then centre it over the columns in the worksheet, once again from within code in vb.

    Have tried recording macros etc in Excel with no success.

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Post

    Hi,

    Mail your question to kenx@jpi.mozcom.com !!
    He might give you an answer. (He gave me some great code for Excell a few days ago)

    R@emdonck

  3. #3
    New Member
    Join Date
    Oct 1999
    Location
    Amersfoort
    Posts
    15

    Post

    About fitting to the length of your cell.
    I recorded a macro and looked at the code

    Columns("A:A").Select
    Selection.Columns.AutoFit

    This is the same as: Format - column- autofit selection. (in excel 95)

    SU

Posting Permissions

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



Click Here to Expand Forum to Full Width