Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Importing a string as columns.

Assuming the separator is (say) a comma (not as your sample which includes
commas & spaces)

Sub Test()
Dim i As Long
Dim sData As String
Dim arr
For i = 1 To 1 ' some loop to get the string
sData = "52014,1868,6169,1259,133878,88,4544190,93464, 88"
arr = Split(sData, ",")
Cells(i, 1).Resize(, UBound(arr)).Value = arr
Next
End Sub

Regards,
Peter T


"Darren" wrote in message
...
Using a data connection, I get the following string:
52014,1868,61691259 133878,88,4544190 93464,88,4466101 194208,89,4851141
164320,89,4972916 234386,80,2033390 119520,70,756142 196767,82,2477652
102349,89,5179496 138197,86,3669161 186012,85,3352716 224651,77,1599646
7666,99,13271321 53994,76,1385884 88911,71,828589 94489,77,1483429
72524,67,580513 25455,75,1215975 62641,71,830699 90562,75,1231729
65625,68,607909 31582,73,999948 180230,64,433406 96940,61,305742
64779,68,613564 -1,-1 -1,-1 -1,-1 -1,-1.
At the moment I extract 90 such strings and have written a macro to
separate
each string into columns. Having it done as I open the sheet would make it
so
much easier for me.
Is there a way to display the string as columns directly from the download
without going through 'text to columns, select delimiter, do not download
column'?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing a string as columns. Nigel[_2_] Excel Programming 0 May 8th 09 08:52 AM
number as string with importing txt file alfred wallace Excel Discussion (Misc queries) 2 April 16th 08 11:51 PM
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) Brian Excel Programming 3 February 9th 06 03:38 PM
Importing Long String - String Manipulation (EDI EANCOM 96a) Brian Excel Programming 6 February 9th 06 12:27 PM
Importing/Exporting text files and string editing Slick Willie Excel Programming 1 September 23rd 04 12:24 AM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"