Question : using multi-dimensional array

I have a ms excel file that has different columns within one cell. I pasted this information into one column of excel from a file. I am trying to transfer certain information from the ms excel file. The file contains many rows and from each row I want to be able to pull certain information and then transfer it to another excel sheet with the information I want . I kow I have to use an array to be able to select the information that I want from each row and transfer each piece of information into separate cells(columns) in another excell file.  

Answer : using multi-dimensional array

Hello NovatoNuevo,
The easiest way to solve your problem is to put each word in a separate cell. You can then use regular worksheet formulas to retrieve your data.

The easy way to put each word in a separate cell uses the Text to Columns tool.
1) Select the cells to be converted
2) Open the Data...Text to Columns menu item
3) In the first step of the wizard, choose "Delimited" ("Fixed if you want to get rid of certain information)
4) Click "Next"
5) Check the box for Space character as the delimiter. You may also want to check the box for Other and enter the a non-breaking space in the field next to it. To enter a non-breaking space, hold the ALT key down and type 0160 using the numeric keypad (this trick won't work using the digits above QWERTY).
6) Click "Finish"

If you want to use a VBA function to return a word in a certain position from a given row, you can use a user-defined function to parse the data. You can then use a formula like:
=Parser(A1,3)           returns the third word in cell A1

To install a function in a regular module sheet:
1) ALT + F11 to open the VBA Editor
2) Use the Insert...Module menu item to create a blank module sheet
3) Paste the suggested code in this module sheet
4) ALT + F11 to return to the spreadsheet

Optional: to add descriptive text (appears at bottom of Function Wizard):
5) ALT + F8 to open the macro window
6) Type in the name of your function in the "Macro name" field at the top
7) Press the "Options" button
8) Enter some descriptive text telling what the function does in the "Description" field
9) Click the "OK" button

If the above procedure doesn't work, then you need to change your macro security setting. To do so, open the Tools...Macro...Security menu item. Choose Medium, then click OK.

Regards,

Brad
1:
2:
3:
4:
5:
6:
7:
Function Parser(sText As String, iPosition As Integer) As String
'Breaks sText into "words" using space character as delimiter _
    Returns word at position iPosition in sText
On Error Resume Next
Parser = Split(Application.Trim(Replace(sText, Chr(160), " ")), " ")(iPosition - 1)
On Error GoTo 0
End Function
Random Solutions  
 
programming4us programming4us