Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a Macro

Status
Not open for further replies.

ROSER72

Technical User
Aug 14, 2007
99
ES
Hi,

I am a newbie to VB therefore I would appreciate some help with a macro.

Provided a table that looks like this:
1
2
3
4
9
10
11
12
13

I would like to have the results presented like this:
1-4,9,10-13

I would like to have a list input and have as a result a number grouping of consecutuve numbers.

Regards,
Roser72
 
1-4,9,10-13
Why not this ?
1-4,9-13

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry I meant

1
2
3
4
7
9
10
11
12
13

to

1-4,7,9-13
 
So, what have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Have not tried anything don't know where to start
 
Just to know, which Application ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Excel. I'm importing a list of numbers from a terminal which I need to compare to another list. The list from which I compare it from is already grouped. By doing a macro that groups it I would be able to compare the two list quicker.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top