+ Reply to Thread
Results 1 to 7 of 7

VBA code not working

  1. #1
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    VBA code not working

    I have a short code to see if each cell in the Parcel# column is empty. If there is nothing in the cell, the word "Deleted" should appear in the Status column in the same row. I'm looking for a reason this is not working. I've tried .formula instead of .value also. It seems like this is right to me. Thanks!

    fyi: table1 is declared earlier in sub.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: VBA code not working

    from the part you've posted [without looking at rest of it], it seems like your are exiting For loop after first match.
    Why do you need to Exit For loop without completing it?
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: VBA code not working

    Definitely don't need it if it's not supposed to be there. Just new to VBA.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,418

    Re: VBA code not working

    Quote Originally Posted by jmklei0 View Post
    Please Login or Register  to view this content.
    I believe all of the above code (assuming the Exit For has been removed) can be replaced by this single line of code...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: VBA code not working

    Quote Originally Posted by Rick Rothstein View Post
    I believe all of the above code (assuming the Exit For has been removed) can be replaced by this single line of code...
    Please Login or Register  to view this content.
    This could work if I changed my original goal to say "deleted" in the search (Parcel) column, but it was actually to say it in the Status column instead.

    Nonetheless, I appreciate your help. But, a) this code doesn't work even though I tried it and looked up more about the Replace variable and b) I'm tired of failing at this line and moved on to a different approach, which does accomplish my goal.

    Thank you. The conversation could continue to help others in the future, though.

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,418

    Re: VBA code not working

    Quote Originally Posted by jmklei0 View Post
    This could work if I changed my original goal to say "deleted" in the search (Parcel) column, but it was actually to say it in the Status column instead.
    Whoops! A bad reading of your question on my part.


    Quote Originally Posted by jmklei0 View Post
    Nonetheless, I appreciate your help. But, a) this code doesn't work even though I tried it and looked up more about the Replace variable and b) I'm tired of failing at this line and moved on to a different approach, which does accomplish my goal.

    Thank you. The conversation could continue to help others in the future, though.
    To continue the conversation, I believe the following would work for you...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: VBA code not working

    That's excellent help. Thank you Rick. The Evaluate function seems great but will need to check it out even more. This did exactly what I needed.

+ 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] This code not working in a Protected Sheet, can any one pls edit this code
    By rajeshn_in in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2016, 01:08 AM
  2. [SOLVED] Pattern Building VBA Code - Working code, would like to use cleaner code
    By Benisato in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2015, 03:05 PM
  3. [SOLVED] Vba code working in workbook module but not working from personal.xlb
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-19-2014, 05:47 AM
  4. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  5. Removing code line stops code working?!?!?
    By adamj1910 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2012, 02:36 PM
  6. [SOLVED] VBA Code (colums to row, autofill) stop working in row 294 when new cable code appear
    By sknifseht in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2012, 05:27 AM
  7. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 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