VBA create string array

Lesceline Gibson

Well-known Member
Joined
Apr 6, 2012
Messages
727
Hi Guys

I have 3 columns A2:C10 where i put an Id in ie 12345
now some cells could have blanks, an Id or multiple Ids separated by a comma

what i want to be able to do is if the cell has an id or multiple ids then create a string like this
<found>
for some reason its lost my string concat

it should be like this

(Found)
(ID)123456(/ID)
(/Found)


(Found)
(ID)555555(/ID)
(/Found)


<found><found><found><found><found>If the cell is blank then skip over it and dont process it
If all cells are blank the exit sub saying no data to import

I hope this makes sense

thank
you</found></found></found></found></found></found>
 
Last edited:

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
434
Multiple id's separated by a comma, or a comma then space?
Where do you want the stings to go?
And in what format? Is it

(Found)
(ID)123456(/ID)
(/Found)

(Found)
(ID)123457(/ID)
(/Found)

or

(Found)(ID)123456(/ID)(/Found)(Found)(ID)123457(/ID)(/Found)

If there's only 1 id in a cell, is it just

(Found)
(ID)123456(/ID)
(/Found)

or

(Found)(ID)123456(/ID)(/Found)

Are you happy with a VBA solution, or do you want Power Query or formula's?
 
Last edited:

Lesceline Gibson

Well-known Member
Joined
Apr 6, 2012
Messages
727
Hi

I need it in this format and it will need to be VBA

(Found)
(ID)123456(/ID)
(/Found)

(Found)
(ID)123457(/ID)
(/Found)

it should be stored in sheet output cell A1

problem is that it should be seperated by a comma then space but sometimes agents could do it in just comma or comma then space or double space so will need to get values only between the commas
 

Forum statistics

Threads
1,077,993
Messages
5,337,606
Members
399,156
Latest member
RaudMees

Some videos you may like

This Week's Hot Topics

Top