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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
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.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,689
Members
449,117
Latest member
Aaagu

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
Back
Top