+ Reply to Thread
Results 1 to 5 of 5

Highlighting and performing macros on selected cells only?

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Connecticut, US
    MS-Off Ver
    Excel 2003
    Posts
    2

    Highlighting and performing macros on selected cells only?

    Hello All,
    I have a report that I run for billing every 28 days. The data I use comes from a billing software that is not useful to me, so I pull the data and re-format it in excel which helps me more. Below is a copy of a Macro that works perfect, however, I cannot get it to run on more than one selected cell at a time. Ideally, I'd like to be able to highlight any number of cells and run my macro. Every 28 days, the report will change, so I don't know how many rows of data I might have. I have one macro that takes care of the headings (eliminates some, and adds different ones...) and then a seperate macro that will add spacing, outline boxes, merge cell, etc..) Can I combine the two? Can I run the macro to take care of my headings AND format the cells the way I want without having to highlight? The first Macro is for heading, the second is for the spacing of data within my cells. Any help would be appreciated!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Highlighting and performing macros on selected cells only?

    A sample file would help... Try making one with dummy data in it if you can, showing how your raw data looks and how you want it to look.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting and performing macros on selected cells only?

    Hi jfbouchard,

    Here's a way to combine them:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    07-31-2012
    Location
    Connecticut, US
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Highlighting and performing macros on selected cells only?

    Thanks, attached is how the data looks from my billing program before, and then after I run two seperate macros...

    I can't combine the two macros yet, I have to run my "Header" separately so that once my header is okay, I can run my second macro to take care of the "BodySpacing". Any ideas...?
    Attached Files Attached Files

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting and performing macros on selected cells only?

    Hey jfbouchard,

    If you combine them it would be the same as if you just called each one in turn - the way I presented it to you, if Header doesn't run then BodySpacing wouldn't get called.


    Here's a routine that does it all:

    Please Login or Register  to view this content.
    Last edited by xladept; 08-01-2012 at 01:38 PM.

+ 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