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.
 

Some videos you may like

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
75,915
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,113,955
Messages
5,545,167
Members
410,667
Latest member
Gaexel
Top