+ Reply to Thread
Results 1 to 10 of 10

Userform, show the last row before deleting it

  1. #1
    Forum Contributor
    Join Date
    05-05-2020
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    100

    Userform, show the last row before deleting it

    Hello,

    In a userfrorm I added a button to delete the last row of the data. I also added a MsgBox to make sure the user won't delete anything by accident.

    Is it possible to show the last row in the message box so that the user can see what he/she is deleting? Or do I have to make a new userform to do this?

    this is the delete button:
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Userform, show the last row before deleting it

    You can use textjoin()

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-05-2020
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    100

    Re: Userform, show the last row before deleting it

    Quote Originally Posted by davesexcel View Post
    You can use textjoin()

    Please Login or Register  to view this content.
    I get this error "error 438, object doesn't support this property or method" and this line is marked :
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Userform, show the last row before deleting it

    Okay,
    It worked for me, can you supply the sample , possibly there is something amiss.

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

    Re: Userform, show the last row before deleting it

    Please Login or Register  to view this content.
    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!!!

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Userform, show the last row before deleting it

    Why not select the last row with a listbox/combobox you can then view the contents and then delete.
    play with the attached simple approach no search strings required, direct relationship between .listindex and row number.
    torachan.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-05-2020
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    100

    Re: Userform, show the last row before deleting it

    Quote Originally Posted by sintek View Post
    Please Login or Register  to view this content.
    This Solved the problem
    Thank you

  8. #8
    Forum Contributor
    Join Date
    05-05-2020
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    100

    Re: Userform, show the last row before deleting it

    Quote Originally Posted by torachan View Post
    Why not select the last row with a listbox/combobox you can then view the contents and then delete.
    play with the attached simple approach no search strings required, direct relationship between .listindex and row number.
    torachan.
    This is really nice!
    I want to add a edit button as well and this will solve both of them \(^○^)/
    Thank you

  9. #9
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Userform, show the last row before deleting it

    Select your item from the listbox > alter data in textbox > update.
    When you enter a new row first use the Clear button to ensure form is empty.

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

    Re: Userform, show the last row before deleting it

    Glad to have helped...tx for rep +

+ 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] Userform Launch - show userform when any cell in range on any worksheet is double clicked
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-27-2016, 03:38 AM
  2. Calendar Userform - Keeps deleting
    By dirtydan86 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2013, 10:32 AM
  3. deleting an entry in a userform
    By bsizzle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2013, 08:01 PM
  4. UserForm to search sheet, show results on separate userform?
    By egemenkepekci in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2010, 01:06 PM
  5. userform is large.....how to use scrollbar of userform to show all of the userform
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2010, 04:11 PM
  6. [SOLVED] Userform: looking for and deleting character
    By Gert-Jan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2006, 10:10 AM
  7. [SOLVED] DELETING DATA FROM USERFORM
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2005, 01: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