+ Reply to Thread
Results 1 to 5 of 5

Help needed on How to loop through numbers split with a comma in form text box.

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    44

    Help needed on How to loop through numbers split with a comma in form text box.

    The code below doesn't seem to work when trying to see if numbers entered into a form text box match the integer from a whole number entered into a cell on the worksheet. For example, if I enter 8 into cell E7 and enter 1,4,6 into the userform text box, I want the code to be able to Loop through numbers 1-8 one at a time and see if they match any of the numbers in the userform textbox. If that number matches then the shape inserted on the worksheet will be a different color with that number inside the shape than the rest of the numbers. So using the above, shapes 1,4,6 will be green and shapes 2,3,5,7,8 will be blue. Thanks....

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Help needed on How to loop through numbers split with a comma in form text box.

    if the text box data is separate like 1, 2, 3 instead of 1,2,3 then you might need to
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    08-21-2013
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Help needed on How to loop through numbers split with a comma in form text box.

    I tried this one but it gives me an object error at the underlined part.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Help needed on How to loop through numbers split with a comma in form text box.

    Next guess, try
    Please Login or Register  to view this content.

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Help needed on How to loop through numbers split with a comma in form text box.

    Did you try post #4 suggestion?

+ 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. Replies: 5
    Last Post: 05-25-2020, 01:12 AM
  2. split cell into rows by using comma (Macro needed)
    By shankar680 in forum Excel General
    Replies: 1
    Last Post: 07-21-2016, 01:02 PM
  3. Split numbers in one cell deliminated by comma to separate cells
    By renix in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-27-2015, 02:07 PM
  4. [ask] split text with comma to new rows
    By qiyusi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2015, 09:27 PM
  5. [SOLVED] Split out text after each incidence of a comma
    By djfatboyfats in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-18-2014, 11:27 AM
  6. [SOLVED] split numbers with comma
    By max_max in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-10-2013, 05:26 PM
  7. Replies: 4
    Last Post: 07-25-2013, 05:28 AM

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