+ Reply to Thread
Results 1 to 4 of 4

How to alter this code to work

  1. #1
    Registered User
    Join Date
    06-13-2016
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    95

    How to alter this code to work

    Hi all,

    I have 2 sheets, CLients and Equity. In CLients I have a list in Col A. I want any of the cells in ColK onwards in Sheet Equity, if they are contained in the list in Col A, to change their background.

    The code I have works only for the first match in Equity for each cell in Col A of CLients, how can I apply it to all matches in Equity?
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    06-13-2016
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    95

    Re: How to alter this code to work

    Nevermind, I have fixed this myself.
    Realized I should loop the otherway around.

    This code works now
    Please Login or Register  to view this content.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to alter this code to work

    First, I would be doing this with Conditional Formatting instead of code. When an Excel feature does exactly what you want, there are a few reasons to use it instead of a custom code solution.

    Try this. I don't have your file so I can't test it. If you attach your file I would be happy to try it out.

    You have undeclared variables. I recommend you use Option Explicit and declare all variables.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    06-13-2016
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    95

    Re: How to alter this code to work

    hi 6StringJazzer , I was trying conditional format initially, but had no idea how to do it, because my range from K2 onwards is dynamic in both row length and column length.

    Even though i have the macro working now, If you can help me with getting an equation for this for conditional formatting, i would very much appreciate it!!

+ 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. Alter code for only first sheet
    By bosco2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2015, 03:12 PM
  2. Alter existing VBA code to work in all worksheets
    By elxx81 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2014, 08:54 AM
  3. [SOLVED] Alter a Deletion Code...Help
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-12-2014, 02:03 PM
  4. [SOLVED] Alter code to work only on workbooks with a specific prefix?
    By james 35 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2013, 09:30 AM
  5. Alter code to reference different worksheet
    By tuckjoseph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2010, 07:01 AM
  6. How to alter a recorded macro to work better
    By antonymiller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2009, 02:53 AM
  7. Alter value in one cell alter value in multiple cells
    By Bryan Noqw in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-11-2008, 05:31 AM

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