Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: formatting a column w/ macro, when top row is merged

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    87
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    My top row is merged (10 columns together). I wrote a macro to format a column as a percentage:

    Columns("C:C").Select
    Selection.NumberFormat = "0%"

    Manually, it works fine to click on the column heading and format it. But by doing it via macro, since the top row is merged it changed ALL of my number columns to a percentage. How do I get around this?? thanks!!

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-08 12:50, graphage wrote:
    My top row is merged (10 columns together). I wrote a macro to format a column as a percentage:

    Columns("C:C").Select
    Selection.NumberFormat = "0%"

    Manually, it works fine to click on the column heading and format it. But by doing it via macro, since the top row is merged it changed ALL of my number columns to a percentage. How do I get around this?? thanks!!
    Try

    Columns("C:C").NumberFormat = "0%"



    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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