+ Reply to Thread
Results 1 to 5 of 5

Changing width of a column

  1. #1
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    Changing width of a column

    Hello All,

    The command I got by recording a macro to change a column's width is

    Please Login or Register  to view this content.
    In my case, I copy data from different workbooks in a folder and in different cases, different number of columns will be filled and I would like to change width of all the columns in the new workbook, that are eventually filled up (starting from Column D). is it possible to do it using a macro, may be by writing some command in the loop structure that changes the width after the column is filled.

    This loop copies data from different files (in a folder) to the present workbook, so may be it can also change the width for the columns after it pastes the data to it.

    Thank you and regards
    arora
    Last edited by royUK; 09-08-2008 at 03:54 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please use Code Tags, even for single lines of code.

    Why not use

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    Thank you

    Hello RoyUK,

    Thank you for the reply and I am Sorry for not using code tags !!

    The command you gave changes the full sheet. I just want to reduce the width of columns starting from column D and I need to keep columns A, B and C intact. Also, is it possible to reduce the width by a desired amount and not 'autofit', Is it possible !!

    Thank you again
    arora

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    thanks a lot

    Hello RoyUK,

    Your code works fine technically,

    I made few changes (original one was selecting columns A to D)

    the changed code goes like this [ with code tags ]

    Please Login or Register  to view this content.
    Thank you once again for helping me,

    regards
    arora

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-23-2008, 09:56 AM
  2. column width
    By muskie in forum Excel General
    Replies: 4
    Last Post: 05-18-2008, 11:55 AM
  3. Changing link & formula column
    By yaduck23 in forum Excel General
    Replies: 2
    Last Post: 04-12-2008, 01:58 PM
  4. Column Width
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2008, 04:24 PM
  5. Waterfall-chart with variable column width
    By Haubner06 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-19-2007, 03:11 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1