A
A
Alexey Smirnov2015-12-30 20:13:36
Visual Basic
Alexey Smirnov, 2015-12-30 20:13:36

How to write a macro in Excel that would “sort” a row of data from a cell into a table?

Hello.
There is this line of data:

1. Switzerland (7.587) 2. Iceland (7.561) 3. Denmark (7.527) 4. Norway (7.522) 5. Canada (7.427) 6. Finland (7.406) 7. Netherlands (7.378)

This row of data is located in one cell of the Excel spreadsheet.
I need to write a macro in the Visual Basic for Application language, which would turn this line of data ("sorted") into a table in Excel. That is, in the 1st column of the Excel table, the numbering of the rating of countries would be located, in the 2nd column the names of countries, in the 3rd numeric values ​​​​from brackets ().
To get it like this (each value in its own Excel spreadsheet cell):
1 Switzerland 7.587
2 Iceland 7.561
3 Denmark 7.527
4 Norway 7.522
5 Canada 7.427
How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2015-12-30
@ERAFY

You do not have a question, but a task that is not on the topic of the resource.
But you can write a sequence of keys, and do the following:
1. Data - by columns, with a delimiter closing bracket ")" - divide by cells.
2. Then copy and transpose the cells - flip the horizontal to vertical
3. Then the replacement text, remove the brackets (change to empty)
4. Then again the data in the columns, with a space separator.
The recorded macro can be viewed in VB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question