+ Reply to Thread
Results 1 to 7 of 7

sub to put values of all cells that begins with a specific text, separated by commas

  1. #1
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    sub to put values of all cells that begins with a specific text, separated by commas

    Good morning guys,

    I currently have a task that I repeat everyday.

    So I usually end up with something like this:


    DoqjWro.png

    Then I manually copy all the Product Codes begins with "BE..." and put it in the clipboard to be paste somewhere else.

    I wonder if you can help me get a sub to scan through the worksheet and copy:

    BE1234
    BE1333
    BE1113
    and put them on my clip board as BE1234, BE1333, BE1113

    Thanks!

  2. #2
    Registered User
    Join Date
    09-20-2016
    Location
    bhopal
    MS-Off Ver
    2003
    Posts
    17

    Re: sub to put values of all cells that begins with a specific text, separated by commas

    Hi,

    rather use Sub / macro , one should use SORT & then copy it .

    if u like to use Sub , use

    Do until

    loop

    function in VB



    Regards

  3. #3
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Re: sub to put values of all cells that begins with a specific text, separated by commas

    Quote Originally Posted by adm.patrikbpl View Post
    Hi,

    rather use Sub / macro , one should use SORT & then copy it .

    if u like to use Sub , use

    Do until

    loop

    function in VB



    Regards
    I would rather not use sort, as the document should still look in that order for further processing.

    Thanks- would you ellaborate the do until part? Thanks!

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: sub to put values of all cells that begins with a specific text, separated by commas

    Example.
    Product Code in col.A
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Re: sub to put values of all cells that begins with a specific text, separated by commas

    There seems to be an issue with this code
    NWm33sg.png

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: sub to put values of all cells that begins with a specific text, separated by commas

    You need to set the reference to ”Microsoft Forms 2.0 Object Library" or just adding a UserForm will automatically set it.

  7. #7
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Re: sub to put values of all cells that begins with a specific text, separated by commas

    Works great. Thanks guys!

+ 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. 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
  2. Replies: 8
    Last Post: 03-31-2015, 01:06 PM
  3. [SOLVED] Extracting Text Separated by Commas
    By davidmg_13 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-02-2013, 05:18 PM
  4. Cells Separated by commas
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-30-2013, 02:17 PM
  5. [SOLVED] Values separated by Commas - want in separate columns, cells from original cell
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-03-2012, 02:50 PM
  6. Replies: 4
    Last Post: 08-22-2012, 07:22 PM
  7. Colum of emails to row of text separated by commas
    By debspecs in forum Excel General
    Replies: 1
    Last Post: 09-09-2008, 12:32 PM

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