Looping within a cell

kmlutz

New Member
Joined
Oct 2, 2006
Messages
2
Hello...I am a novice coder when it comes to Excel. I have looked into the issue, but am unable to find the logic..if it exists for what I want to do.

I have have found bits and pieces that seem to be what i want - vlookup, match, offset, do while, etc....but nothing exact.

I am using Excel 2003 on Windows XP.

I have a cell that contains data like "group_a;group_b;group_c"....I need to loop through this cell with a master list to verify if anyone has added a group or misspelled a group.

Unfortunately, the cell is in a template that has to stay in this format, but I would like to validate the data before its imported into another system.

Any thoughts would be appreciated.

Thanks.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,309
Office Version
  1. 365
Platform
  1. Windows
Well you could use the Split function to seperate out the groups into an array.

Let's say it's A1 with the data.
Code:
arrValues = Split(Range("A1"), ";"

' arrValues should now contain each group as a seperate item in an array
' we can loop through the array like this
For I = LBound(arrValues) To UBound(arrValues)
      ' work with the individual items of the array
      Msgbox arrValues(I)
Next I
In the example the values are simply displayed but other code could be added to validate them.
 

Forum statistics

Threads
1,144,660
Messages
5,725,645
Members
422,634
Latest member
YenOlmedo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top