+ Reply to Thread
Results 1 to 4 of 4

Macro to format cells, adjust column widths, hide cells

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to format cells, adjust column widths, hide cells

    Hi,

    I am new here and have a question about a macro. I am using Excel 2010. Data is sent to me in an excel document and I would like to be able to reformat it so it can be easlily viewed and printed. I think a macro can be created to do this, but I have very little experience in this area. All the data is on one worksheet. This is what I would like to do:

    Adjust column widths of A, H-K, M-S to 13.
    Change text in cell A1 to "A", H1 to "H", and so on.
    Bold text in cells A1, H1, K1, etc.
    Underline text in cells, A1, H1, K1, etc.

    Hide columns B-G, L, T-AH.

    I can do all this manually, but I would like to be able to do something that would automate the process thus saving time and effort.

    Any help provided would be most appreciated.

    Thanks!!
    Last edited by amsolmyers; 07-07-2010 at 04:49 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to format cells, adjust column widths, hide cells

    Hello amsolmyers,

    Welcome to the Forum!

    This macro will format the specified columns to a width of 13, and add the column letter to the first row in bold,underlined and centered.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Macro to format cells, adjust column widths, hide cells

    Hi Amsolmyers, welcome to the forum.

    You can usually automate activities by using the macro recorder, especially if you're always referencing the same ranges/cells. The code created using the recorder is not always efficient, but it works. Below is some code that does what you're asking, not created using the recorder.

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

  4. #4
    Registered User
    Join Date
    07-07-2010
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to format cells, adjust column widths, hide cells

    That's awesome..thanks So much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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