Split up or delineate data
try:
Dim myStr As String
Dim varData As Variant
myStr = "ant,antique,art,bee,beautiful,bored,chores,dancin g,daytime"
varData = Split(myStr, ",")
Range("A1").Resize(UBound(varData) + 1) = Application.Transpose(varData)
That basically just copied the string into column A. What I meant was, I was also thinking about a solution that doesn't involve spreadsheet cells.
For example, if
myStr = "ant,antique,art,bee,beautiful,bored,chores,dancin g,daytime"
then the output should be:
myStr2 = "--A--,ant,antique,art,--B--,bee, etc.."
But, I'm happy with your initial solution.
Thanks!
|