# display consecutive values vba export text

#### biq3468

##### New Member
Hello,
I am new to Excel VBA, I work as an engineer and use a lot of data in Excel.
I wish I could simplify some of the work by opening this thread.
This may be very simple, but I can't seem to find a way.
Given a column, or a cell with values like :
F001
F002
F003
F004
F017
F020
F021
F121
F122
F123
...
I need a text result in a cell or in a message box to arrange this data into consecutive values, something like this:
"F001 to F004,F017, F020 to F021, F121 to F123 ..."
This text will be then used in other software by paste.
Hope you understand what Im asking.
Thank you very much!

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### My Aswer Is This

##### Well-known Member
Try this:
Code:
``=A1&A2&A3&A4``

Or if you want the commas also:

Code:
``=A1&","&A2&","&A3``

Last edited:

#### My Aswer Is This

##### Well-known Member
If you want a script tell me what column and row number your data begins in and what cell you want the results put in. And how many rows of data you have. Later you can modify this to your liking.

#### biq3468

##### New Member
Hy
I only use one column at a time, so it does not matter.
The only variable is the number of values. The result can be displayed anywhere, so B1 should be just fine.
My only request is to have result in only one cell and with the word "to" in between consecutive.
Thank you!

#### My Aswer Is This

##### Well-known Member
Putting the word "Two" between consecutive numbers is beyond my knowledge base. Someone else may chime in on this thread.</SPAN>

Replies
1
Views
3K
Replies
6
Views
331
Replies
50
Views
4K
Replies
22
Views
1K
Replies
0
Views
279

1,190,841
Messages
5,983,187
Members
439,827
Latest member
JohnExcelHelp99

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back