+ Reply to Thread
Results 1 to 5 of 5

Macro to apply format to cells in same row, different column

  1. #1
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Macro to apply format to cells in same row, different column

    Hi all,

    Attached is a sample Workbook. I need a macro that allows me to go through the contents of column "I" (in sample book, the one called "Dec") and, for each occurrence of the pound symbol (#), go to column A in the same row, and apply a color to that cell and make it bold. I'm gonna be using this macro in sheets, each having different quantity of rows, but the number of columns will always be the same, and the "Dec" column will always be in the same position. Also, I need the macro to not take in consideration the book's name, since I'm gonna be using it in different workbooks and computers.

    From an attempted macro I recorded, this is the info about the color I need: .ThemeColor = xlThemeColorLight2
    .TintAndShade = 0.599993896298105

    Hope this is enough info.

    Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-17-2012
    Location
    Australia
    MS-Off Ver
    MS Office 365
    Posts
    40

    Re: Macro to apply format to cells in same row, different column

    Try this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Macro to apply format to cells in same row, different column

    Hi Brad,

    Thank you so much for your help! The macro worked as expected. However, I have a question. What does need to be changed in order to make it work with any sheet regardless of the name of it (or the book)?

    Thanks!

  4. #4
    Registered User
    Join Date
    06-17-2012
    Location
    Australia
    MS-Off Ver
    MS Office 365
    Posts
    40
    Quote Originally Posted by axtryo View Post
    Hi Brad,

    Thank you so much for your help! The macro worked as expected. However, I have a question. What does need to be changed in order to make it work with any sheet regardless of the name of it (or the book)?

    Thanks!
    No problem, change sheets("sheet 1") to activesheet

  5. #5
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Macro to apply format to cells in same row, different column

    Brad,

    I truly appreciate your help. Now the code works as desired. I'm marking this post as solved.

    Thank you so much.

+ 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. Formatting cells other than select-highlighting the cells to apply the format?
    By Joe Miller in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-27-2014, 10:53 AM
  2. [SOLVED] How do I apply contidtional format to 3 cells with the same value
    By john dalton in forum Excel General
    Replies: 4
    Last Post: 03-27-2014, 08:10 AM
  3. [SOLVED] Macro to apply formula to blank cells in a column is offset (sometimes)
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2013, 01:55 PM
  4. Apply Conditional format only when cells are active?
    By bob63el in forum Excel General
    Replies: 3
    Last Post: 04-03-2013, 10:18 PM
  5. Replies: 3
    Last Post: 09-13-2012, 03:25 AM
  6. Formula/macro - Apply certain formula as per duplicate cells in column L
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2011, 12:28 AM
  7. How to apply a proper date format to an entire column?
    By anb001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-03-2008, 03:47 PM

Tags for this Thread

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