+ Reply to Thread
Results 1 to 3 of 3

Add or remove text form a list using click button

  1. #1
    Registered User
    Join Date
    03-26-2016
    Location
    Belfast
    MS-Off Ver
    2011. 14.6.0
    Posts
    2

    Add or remove text form a list using click button

    Hi all! Having some issues with VBA. Just new to this world and finding my feet.



    I have a cell (B32) with some text (actually a date)

    I want to add this date to a list - list located from cell B42:B48

    Using VBA I would like to do the following (using a click button)

    1. Check the list doesn't already have the Date added -
    a. If so remove the date
    b. If not add the date to the first available row in the list.

    Can this be done - 1 click either puts the date into the list or removes it if already there?

    I have been using the following to add the date - (Range P56 is just another list I wanted the info added to)

    Range("B32").Copy
    Range("B48").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    Range("P56").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

    End Sub

    Hope you guys can help.

    Many thanks in advance.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Add or remove text form a list using click button

    With Dates and times you should always post examples.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window (or use the paperclip icon).


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-26-2016 at 05:09 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    03-26-2016
    Location
    Belfast
    MS-Off Ver
    2011. 14.6.0
    Posts
    2

    Re: Add or remove text form a list using click button

    Many thanks for the swift reply

    As I say I am not the best at this, just learning. I perhaps can explain myself better

    From what you have sent me I can't seem to get the code to work.

    I have done as you have suggested and attached a sample workbook.

    ---------

    Some further info -

    Sheet : Before - Add Player

    Group A - I would like to use a click button to add players to the AVAILABLE list below - B23:B29, and if possible remove the player if I click again on the button assigned to the player --

    e.g.

    Cell B11 = JOHN.A

    Click on button located over the cell B11- Add player to next available cell in the range B23:B29. If player already located in this range then remove player.


    I would also like to highlight the cell that the player name is originally located in (e.g. Select JOHN.A - he is added to the AVAILABLE list, highlight cell B11.


    I maybe also creating another scenario though -

    What if I have selected JOHN.A , JOHN.C and JOHN.G.
    These players appear in the Range B23:B29
    JOHN.A in B23
    JOHN.C in B24
    JOHN.C in B25


    I decided to remove JOHN.A, will JOHN.C and JOHN.G automatically move up to the the free cell vacated by JOHN.A?

    e.g
    Click button over JOHN.A (Cell B11) - JOHN.A is removed
    JOHN.C in B23
    JOHN.C in B24


    Also included

    Dates - Its the same scenario as the Player Add.



    Thanks again. Hope I have better explained this !
    Attached Files Attached Files

+ 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] Form button on click event not trigerring
    By Umair.711 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-16-2014, 01:24 PM
  2. [SOLVED] shift click on form button
    By vedroks in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-23-2012, 02:05 PM
  3. Error on userform remove button click
    By gsurge in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-11-2012, 08:45 AM
  4. Why is the scrollbar in a user form, by the first click on a button, scrolling?
    By Excel-Master in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-21-2010, 11:01 PM
  5. How do I program a 'click' for a button on a form
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2009, 08:54 AM
  6. Add a remove button to form
    By Khaos176 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-19-2008, 12:33 PM
  7. Populate an Excel Form from a table on push button click
    By munzer1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2007, 09:55 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