+ Reply to Thread
Results 1 to 3 of 3

Adding values to concatenate function by clicking buttons

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2015
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    34

    Adding values to concatenate function by clicking buttons

    Hello,

    I would like to build concatenate function using buttons with assigned macros:

    1)
    I create button called "concatenate start" and want to assign to it a macro that
    send value to any cell I select equals to =concatenate(

    2) next buttons after click should add remaining value to =concatenate function i.e. Main Category button -> =concatenate("Main Category"

    3) next button after click add semicolon in active cell -> =concatenate("Main Category";

    and so on.


    In general how can I build =concenation function in any selected cell by clicking buttons which adding values to other values in this cell.

    I have many rows with data and it is easier to click buttons than coping/pasting data

    29547ic.jpg
    Attached Files Attached Files
    Last edited by pomper; 06-20-2017 at 11:42 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: Adding values to concatenate function by clicking buttons

    Do you really want a formula? It would be easier to have the macro concatenate the values and put them in your selected cell like this...
    • First, select the cells you want to concatenate (Ctrl+Click each cell)
    • Run the Concat macro
    • The Macro prompts you to select the destination cell and places the concatenated result there.


    Sub Concat()
        Dim cell As Range, strConcat As String, rng As Range
        For Each cell In Selection
            strConcat = strConcat & cell.Value & "; "
        Next
        strConcat = Left(strConcat, Len(strConcat) - 2)
        On Error Resume Next
        Set rng = Application.InputBox("Select the cell where you want the concatinated result.", "Concatinate Destination", Type:=8)
        On Error GoTo 0
        If Not rng Is Nothing Then rng.Value = strConcat
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-06-2015
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Adding values to concatenate function by clicking buttons

    This code works . Can you please help me to modify your code to solve similar task:
    https://www.excelforum.com/excel-pro...ml#post4680794

+ 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. Hide buttons when clicking
    By DDayWalker182 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2016, 02:22 PM
  2. CONCATENATE function for values to be separated by commas
    By dejhantulip in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2016, 05:12 PM
  3. [SOLVED] Addin W/ Ribbon: Restict Users from clicking buttons from wrong sheet.
    By sud123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2013, 05:33 PM
  4. Adding a count to concatenate range function
    By mbus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2013, 11:18 PM
  5. [SOLVED] Excel function or script for concatenate all values from B:B for same columns in A:A
    By Odeen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2012, 10:29 AM
  6. Replies: 3
    Last Post: 02-28-2012, 02:05 PM
  7. Entering input and clicking buttons during loop
    By FlyinJack in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2009, 07:47 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