+ Reply to Thread
Results 1 to 12 of 12

Need macro using If Condition with Msg box

  1. #1
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Need macro using If Condition with Msg box

    Hi all,

    I need a macro that should identify the blanks in the entire Column D and should reflect with the Msg box "Please update the blanks" if any blanks received or else it can proceed with the another subroutine. After getting the msg box it should automatically delete the Column D.

    Please help....

  2. #2
    Registered User
    Join Date
    01-03-2014
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Need macro using If Condition with Msg box

    Why would you update the data that is blank in column D and then delete column d.
    have i missed something here???

  3. #3
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    Actually my requirement is

    1. I Should identify the blanks in the Column D
    2. If i found any blanks then i should pop up a msg stating that "There is a blank in this column. Please update the details in your base file"
    3. After receiving the msg box the column D should delete automatically since if i rerun the macro again after updating the details in the base file then again one more column will add.. Because i have written a macro in such a way that column D will insert automatically in the Initial Stage.
    4. If there is no any blanks in the Column D then i should proceed with the next subroutine..

  4. #4
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    any one here to help me out...

  5. #5
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    pls help me.. i struggling to fix this for past 2 weeks..

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need macro using If Condition with Msg box

    Try to call this subroutine in your macro

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    Hi ZBOR,

    Thanks a lot. it works perfectly what i expected. But instead of Clearing the content, i just want to delete the entire column D.

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need macro using If Condition with Msg box

    Then delete column:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    Hi Zbor,

    You are really a genius.. But if there is no any blanks in the Column D then i should proceed with the next subroutine. I tried to call the next subroutine. But it is not working...

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need macro using If Condition with Msg box

    It should work...

    If you have
    Please Login or Register  to view this content.
    Then it will continue if no blank cells

  11. #11
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    Thank you very much.. It works..

  12. #12
    Forum Contributor
    Join Date
    06-01-2015
    Location
    Chennai,India
    MS-Off Ver
    Microsoft Office 2021
    Posts
    146

    Re: Need macro using If Condition with Msg box

    Hi Zbor,

    One more help.. If the column D contains Blanks then i need to highlight the entire row and then i should get that MSG BOX. Have tried the below. But it is not working

    .Entirerow.Interiorcolor =45

+ 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. Run Excel Macro IF certain condition is met, else exit Macro
    By Martin Chamberlin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-27-2014, 03:13 AM
  2. Macro with condition of Period, before run, macro should validate the date and Path of fil
    By caapoorvajain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2012, 04:11 AM
  3. Excel 2007 : Macro with yes or no condition
    By httdy1 in forum Excel General
    Replies: 1
    Last Post: 10-08-2010, 07:07 PM
  4. add some condition to macro
    By johncena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2010, 09:48 AM
  5. Add Condition to Macro
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2007, 11:04 AM
  6. Add Condition To Macro
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2007, 05:47 PM
  7. Run Macro until a condition is met
    By tx12345 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2006, 09:02 PM

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