+ Reply to Thread
Results 1 to 7 of 7

Double click cell, add to list

  1. #1
    Forum Contributor
    Join Date
    12-14-2017
    Location
    birmingham, england
    MS-Off Ver
    2016
    Posts
    102

    Double click cell, add to list

    Hi,

    I have a list of item that i when selected, or double clicked i want to add to a list, in the order they were clicked.

    For example, a list of items in column A, double click one of them and it will paste into b1. Double click the next one and it will paste into b2 etc etc.

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this ‼


    Paste next code to the worksheet module :

    PHP Code: 
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As RangeCancel As Boolean)
        
    Dim R&
        If 
    Target.Column 1 Then
            Cancel 
    True
            R 
    Cells(Rows.Count2).End(xlUp).Row
            Cells
    (- (Cells(R2).Value ""), 2).Value Target.Value
        End 
    If
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 05-25-2018 at 05:49 AM. Reason: optimization …

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Double click cell, add to list

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    Yasser :

    PHP Code: 
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As RangeCancel As Boolean)
        If 
    Target.Column 1 Then
            Cancel 
    True
            
    If [B1].Value "" Then [B1].Value Target.Value Else Cells(Rows.Count2).End(xlUp)(2).Value Target.Value
        End 
    If
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Double click cell, add to list

    Thanks a lot Mr. Marc for guiding all the time
    Best Regards

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Double click cell, add to list


    You're welcome padawan, may the Force be with you !

    I just edit my post #2 code …

  7. #7
    Forum Contributor
    Join Date
    12-14-2017
    Location
    birmingham, england
    MS-Off Ver
    2016
    Posts
    102

    Re: Double click cell, add to list

    Looks perfect, for what i asked for!

    Theres a more complicated query that i wondered if anyone could look at.

    I have this world cup result predictor that a colleague made at work. VERY SIMPLE STUFF and he told me to leave it alone, because "it does the job"

    Im not having that, i have to make it more automated that what hes done!

    If you see attached, i want to be able to select a team and have them appear in the selected order, in the 1st, 2nd, 3rd and 4th Place for each group.

    Any ideas? Cheers
    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. Double click on list box
    By dan113 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2017, 10:57 AM
  2. Double click cell - copy data to new sheet - create a list from double clicking
    By kakky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-04-2015, 11:14 PM
  3. [SOLVED] Before double click event with if statements (Double clicking blank cell stops bdc firing)
    By camdenpars in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2014, 09:03 AM
  4. Changing cell properties with double click, then revert with another double click
    By mweber2525 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-01-2014, 01:40 PM
  5. Copy double-clicked cell to next empty row in different sheet with each double-click
    By erhathaway in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-25-2013, 12:06 AM
  6. [SOLVED] Double click from List Box and populate data into another cell
    By shaneg1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-27-2013, 04:16 AM
  7. Replies: 4
    Last Post: 08-02-2005, 09: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