+ Reply to Thread
Results 1 to 8 of 8

Help to make macro to blank cell if equal to another cell "dynamic".

  1. #1
    Registered User
    Join Date
    04-10-2020
    Location
    Dublin, Ireland
    MS-Off Ver
    Office365
    Posts
    28

    Help to make macro to blank cell if equal to another cell "dynamic".

    Hi all,

    Quick question (I hope) Very new to macros, but so far really enjoying playing around with them and learning and trying to apply it to an excel dashboard I use at work.

    I use a simple advanced filter macro to extract unique list of names and copy to a column, then I need to remove or blank some names from an exclusion list. This list of names is used in my dashboard.

    The below works fine, but I would like to make it "dynamic". Now it will just blank the 2 names I have in K2 and K3 respectively, but if a name is added in K4 and so on I would have to update the macro. Since my colleagues use my dashboard I would prefer to avoid this.

    I was thinking to use For again in some way for the 2 and 3 in Cells(2, 11) and Cells(3, 11) so For j = 2 to 10, but it's not working out...

    Any tips (or hints even) would greatly appreciated.

    Please Login or Register  to view this content.
    Last edited by RuairiO; 04-26-2020 at 11:53 AM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    Hallo RuairiO

    Welcome to our Forum...

    Please take a moment to read our forum rules...here
    Your post does not comply with Rule # 2
    2. Programming code must be enclosed in code tags to improve readability. (A, Z)
    Please Login or Register  to view this content.
    So...Edit your post...Highlight the code and press the # button

    Also...Have a look at yellow banner on Top about uploading a sample file...This assists with accurate supply of correct code assistance...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-10-2020
    Location
    Dublin, Ireland
    MS-Off Ver
    Office365
    Posts
    28

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    Hi all,

    I actually figured it out kind of... I had to use one more Next I didn't notice that. I've done it now like this.

    I do notice it makes now a lot of loops. Will that be an issue if the data is quite large?

    Please Login or Register  to view this content.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    Why not upload a sample file as suggested and we can simplify for you...
    Thanks for adding code tags

  5. #5
    Registered User
    Join Date
    04-10-2020
    Location
    Dublin, Ireland
    MS-Off Ver
    Office365
    Posts
    28

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    Yeah sorry. Attached it now (hopefully).

    Thanks for any feedback/hints. Much appreciated.

    Br,

    Rory
    Attached Files Attached Files

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    One way...
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-10-2020
    Location
    Dublin, Ireland
    MS-Off Ver
    Office365
    Posts
    28

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    Could have sworn I replied with a thanks earlier, but anyway big thank you! I really appreciate you taking the effort to help some random guy from the internet! I hope to pay it forward in the future!

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Help to make macro to blank cell if equal to another cell "dynamic".

    Glad I could contribute...Tx for rep...Please remember to mark as SOLVED...

+ 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. [SOLVED] After writing "xx" to cell in specific sheet, make 5 cells under it blank
    By Cubajz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2017, 11:16 AM
  2. Cell Referencing and IF(Blank) make it " " if else put data from reference cell in
    By Acousticlife81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-03-2017, 09:46 AM
  3. Trying to make "1" equal an value in another cell
    By Frostpirate in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-07-2016, 08:12 PM
  4. Replies: 6
    Last Post: 09-25-2013, 01:51 PM
  5. [SOLVED] How to make a empty "" cell treated as blank
    By twiggywales in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-29-2012, 12:10 PM
  6. [SOLVED] Delete row if cell in Column N equal "Different" or Column P equals "Blank"
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2012, 08:25 AM
  7. [SOLVED] can I make cell "yes" equal 1, "no" equal 0
    By can I make cell "yes" equal 1, in forum Excel General
    Replies: 3
    Last Post: 01-25-2005, 05:06 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