+ Reply to Thread
Results 1 to 3 of 3

macro to generate a list of cells using a specific custom cell style

  1. #1
    Registered User
    Join Date
    01-04-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010, 2013
    Posts
    17

    macro to generate a list of cells using a specific custom cell style

    Hi, I'm looking for some VBA code that might not be possible but I wanted to get some opinions anyway.

    I have a workbook with many worksheets that contain numerous cells with a specific custom cell style called "topic". I would like to be able to generate a master list of the cells using this custom style on a separate wkst (new if not already present). Ideally, I would like the list to contain the contents of the cells (e.g. "Topic1","Topic2", etc.) as well as a reference and hyperlink to that cell. I would be fairly certain these things can be done with built-in styles, I'm just not sure about custom cell styles. Thoughts?

    Below is a code I found that works in a similar vain - it lists all the sheet names onto a specific wkst and provides a hyperlink to each one. I would like pretty much the same thing except for each cell using the custom style. Maybe this would serve as a starting point? I'd appreciate any suggestions

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: macro to generate a list of cells using a specific custom cell style

    Perhaps a macro like this could work?

    Please Login or Register  to view this content.
    This macro writes the result to Sheet1 i.e. the sheet name where the specific font is found, the cell address i.e. $B$4 and the value of that cell. So the problem is if this specific font you are using is listed in the "Drop down" for fonts. You must replace font name "Arial" in the macro of cource.

    Be warned that this is a "slow" macro as it checks all cells in the used range of all sheets except sheet1. If the the specific font is used as say headings or in certain columns the search area for the font could be restricted and this will speed up the time it takes to search all sheets.

    The hyperlink part could be added assuming this macro works.

    Alf

  3. #3
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: macro to generate a list of cells using a specific custom cell style

    Hello,

    Give this try. It will list all your cell styles (except "Normal") like Alf already said watch out it might take some time.

    I did some testing and this is the speeds I get.

    cells: 76341
    Time 52.91s

    Cells: 28882
    Time: 10.39s

    Run the main procedure GetCellStyles

    Please Login or Register  to view this content.
    Thanks

+ 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. Custom macro for removing cells containing specific location keywords
    By swoop.swoop in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2014, 06:34 PM
  2. Replies: 0
    Last Post: 07-11-2013, 02:08 AM
  3. [SOLVED] Macro to generate a random number between 2 specific values into specific cells.
    By Nerfmagnet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-10-2013, 11:45 AM
  4. Replies: 1
    Last Post: 03-26-2013, 02:24 PM
  5. Create macro to generate hyperlink to a specific file from cell
    By Tranen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2012, 12:23 AM

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