+ Reply to Thread
Results 1 to 4 of 4

If not empty do not do macro

  1. #1
    Registered User
    Join Date
    11-02-2014
    Location
    Marbella, Spain
    MS-Off Ver
    Excel Mac 2016
    Posts
    77

    If not empty do not do macro

    Good morning,
    I have 2 macros that work more or less well but I have a problem that I would like to have more "professional working". So I have a macro that copy 2 columns range to other cell as values that is named "Sub copy_details". The problem is that when I run other macro does not recognizes "" as totally empty and the sort is not correct. So I did other macro to clean the "" at the "J" column cells and pass to empty, that it's named "clean_cells_to_empty". The problem is that sometimes does not find cells with "" and appears the error to debug or end macro. What code could I add for in case does not find cells with "" at "J" column, does not do the macro. Shoud be easy to people who knows about this. Thank you very much in advance.

    Please Login or Register  to view this content.
    bye for now.

    BR,
    Pedro

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: If not empty do not do macro

    Hi there,

    This is difficult to test properly without access to your workbook, but see if the following code does what you need:

    Please Login or Register  to view this content.

    Hope this helps.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    11-02-2014
    Location
    Marbella, Spain
    MS-Off Ver
    Excel Mac 2016
    Posts
    77

    Re: If not empty do not do macro

    Fantastic Greg,
    Works like a charm. And what I thought form your macro is that instead having 2 macros "copy_details" and "clean_cells_to_empty", as it can test it before to check empty cells or not, I'm going to include all in the same macro that will be "copy_details". Thank you Greg once again I comment also your rep.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: If not empty do not do macro

    Hi again,

    Many thanks for your very prompt feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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] Using macro to find first empty cell in column. If range is empty returns error.
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-23-2019, 11:03 AM
  2. [SOLVED] Modify macro if found empty cell to do nothing and expand the range of macro
    By oeyandyprawira in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2018, 03:44 AM
  3. Replies: 6
    Last Post: 10-20-2014, 09:37 AM
  4. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  5. [SOLVED] If cell is empty then run macro otherwise skip this macro
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2006, 11:00 AM
  6. [SOLVED] Macro to empty row
    By Bigpond News in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2006, 04:20 AM
  7. macro to colour empty cells (cells not recognized as empty)
    By Gerben in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2005, 11:05 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