• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Short number format

S. Das

Active Member
Sir, I want a data sheet, where data input should be like this:
5132,5133,5134,5135,5144,5145,5146,5150,5158,5159......(in top-down order, i.e, column wise)
But the excel worksheet have to give output like that:
5132-5135,5144-5146,5150,5158-5159.......(in side by side order, i.e, row wise)
Pls help me.
 
Sir, thank you so much for your help. But I need the same thing in a slightly different format. Here I am giving you a sample file, which will help you to understand what I need.
 

Attachments

  • Sample.xlsx
    8.4 KB · Views: 7
@John Jairo V, need one more help. You have already given me the code of Grouping a range of cell, but now I need it's inverse also, where grouped data will be given and the system will ungroup it. See the attached file.
 

Attachments

  • Sample.xlsm
    15 KB · Views: 2
Hi, again!

This last question is better doing with a sub procedure. I have a question: Do you have more than one set of codes, or just one? If you have more than one, attach in excel file an structure of that set. Blessings!
 
Hi Sir,
Actually, I am going to use the code for an examination seat plan system, where students Roll No (10 digits) will be given to the system for a particular room of my college, and the system will group all those values in a single cell.
And the Roll No has no defined format except the 10 digits.

I am facing one more problem, that is your code (as per reply #4) is unable to group 10 digits number in a single cell. Can you tell me how can I make this able to group 10 digit number?

I just want another code which can able to ungroup the data, i.e, the reverse work of your reply #4.

Thank you again
 

Attachments

  • Sample.xlsm
    15 KB · Views: 2
Hi, again!

With little changes, it works. Now too... check file for second question (click in red arrow), taking A1 to start cell, and B1 to down for end results. Blessings!
 

Attachments

  • Sample (2).xlsm
    19.7 KB · Views: 3
Thank you, Sir, for your help, but getting one problem, as my worksheet is a Seat allotment system, there is some if logic.When the logic is true then grouping code is working fine but when the logic is false then its show VALUE error. See the attachment for better understand.

No change needed for ungrouping code. It's working awesome.
 

Attachments

  • Sample (2).xlsm
    19.6 KB · Views: 2
Hi, again!

If you tell us your real structure from the beginning, we do not have to be giving solutions that do not work. Please keep this in mind for the future.

Check the file. Blessings!
 

Attachments

  • Sample.xlsm
    19.6 KB · Views: 7
Sorry to disturb you so many time in the same job. As my main worksheet is larger so I can't upload it here. For that reason, I give you the concept of the problem but I forgot to state the side situations.

In future, I will follow your advice.
Again thank you so much for your help and support.
 
Sir, the function of GroupN is not updating automatically if any value in the given range changes. after pressing CTRL+ALT+SHIFT+F9 or double click in each cell and after pressing enter it works.
Can you suggest me any easy way or any VBA that I will link to a button and after pressing that button all cell will update?
 
Back
Top