+ Reply to Thread
Results 1 to 8 of 8

Ask user to confirm delete action

  1. #1
    Registered User
    Join Date
    05-29-2014
    Posts
    9

    Ask user to confirm delete action

    Hi,

    I'm trying to prompt user when he tries to delete a value from a cell so he can confirm is action but not the same way to all cells.
    Let's say that I have cells A1:F10 with values, and user should be able to change this values but not to delete them (can't be a blank cell) and I want to prompt him that info (something like "Cell can't be blank!").
    In other range a want a different thing: let's say cells H1:K20. In this cells user should be able to change cells values and also delete them but I want to ask him for a confirmation (something like "are you sure").

    Can someone help me?

    PS: My VBA is not so good.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Ask user to confirm delete action

    Something like:
    Please Login or Register  to view this content.
    in the worksheet object module.

  3. #3
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Ask user to confirm delete action

    Check this one.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-29-2014
    Posts
    9

    Re: Ask user to confirm delete action

    ragulduy,
    Thank you a lot. That works perfectly.

  5. #5
    Registered User
    Join Date
    05-29-2014
    Posts
    9

    Re: Ask user to confirm delete action

    Hi again,

    Everything is working fine now but every time I open the file a "run time error 13 - type mismatch" appears and it highlights me this line: "If target.Value = "" Then".
    Any ideias?

    Tks in advance!

    EDIT: It seems like this error appears when the user is trying to delete merged cells value. Is that a limitation?
    Last edited by MiltonSilva; 06-19-2014 at 09:20 AM.

  6. #6
    Registered User
    Join Date
    05-29-2014
    Posts
    9

    Re: Ask user to confirm delete action

    Nobody can help me with this problem when deleting merged cells values?

  7. #7
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Ask user to confirm delete action

    Checked my solution?
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-29-2014
    Posts
    9

    Re: Ask user to confirm delete action

    haripopuri, thank you very much for your reply but in a quick test on your solution it seems like it isn´t working the way I need it. But thank you for your help!

    Anyway, I found a solution to the problem in ragulduy's code, that wasn't working on merged cells.
    On: " If target.Value = "" Then "; we should have: " If target(1).Value = "" Then ".
    That solved it!

    Thank you very much for your help!

+ 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] Message box to confirm user wants to delete record.
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 16
    Last Post: 10-14-2013, 10:50 PM
  2. [SOLVED] Confirm Command button on user form using VBA
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2013, 05:56 AM
  3. Delete sheets in VBA without asking me to confirm
    By jpbalky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2011, 08:56 AM
  4. Macro delete + confirm deletion
    By Sharp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2008, 07:35 AM
  5. [SOLVED] Message box to confirm action
    By CRayF in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2005, 08:05 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