+ Reply to Thread
Results 1 to 4 of 4

Can't replace the selected cell address with the content name.

  1. #1
    Registered User
    Join Date
    10-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 365
    Posts
    50

    Can't replace the selected cell address with the content name.

    I have a list of records showing the names and some particulars of the people.
    When a person has left, I need to delete him/her from the records.
    I have one method (Method A) which allows me to select a data (say name of the person) and then using vba to delete the entire record.
    But instead of the name of the person appearing in the input, the cell address is shown instead. I can't find a way to replace it with the name of the person selected.
    So I would like to have a drop down list of the names of the persons in the records
    where I can select and then clicking on a "Delete" button (using macro) to delete the data of that person from the reocrds.
    How can that be done using vba?
    I'm using MS Office 365 Excel. I've attached a sample file here.
    Thanks in advance.
    KSChan
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Can't replace the selected cell address with the content name.

    try this and attach it to your command button
    Please Login or Register  to view this content.
    Last edited by alansidman; 05-06-2018 at 10:11 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 365
    Posts
    50

    Re: Can't replace the selected cell address with the content name.

    Thank you, Alansidman for your quick solution.
    I've tried your VBA code and it works perfectly.
    I've added two more command lines: One to sort the names after a deletion and second one to re-number the Record No.
    Now I can abandon Method A as it looks very odd to have the cell address showing instead of the name of the person.
    Thanks once again for your help.
    Chan

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Can't replace the selected cell address with the content name.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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 Address to get content in a cell
    By excelquest41 in forum Excel General
    Replies: 2
    Last Post: 04-27-2012, 08:19 AM
  2. Replies: 1
    Last Post: 03-08-2012, 01:57 PM
  3. Replies: 5
    Last Post: 01-28-2011, 07:02 PM
  4. Find/replace with cell content
    By DeeCeeL in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-06-2010, 10:38 AM
  5. replace first character of cell content
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2009, 11:33 AM
  6. Replies: 3
    Last Post: 03-01-2006, 09:10 PM
  7. Get selected cell name/address
    By David494 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-01-2005, 10:21 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