• 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.

want numbers in pairs

Nabeel

Member
dear all

here i need when i run VBA that in given prefix or format i need numbers in shape of couple or pairs max which can be made in numbers. first 3 digit of numbers should be fix,it can be 321,320,322,300 (which i will write) other than 7 digit can vary in shape of couple or pairs.
the pair of 3/3''like 222333 or 666777 one digit can be changed..

Nabeel
 

Attachments

  • couple sample.xlsx
    8.2 KB · Views: 4
Nabeel

It is not at all clear what you are after here

can you try and explain your requirements in a very simple format and maybe give examples, using the sample file data, Before and after examples are great so we can try and work out the patterns/requirements
 
Hi Hui
now i have made 3 sheets golden numbers, silvers numbers and plat numbers with different pairs as example. in every column B sequence showing opposite of column A,means it can also be..you can see that first three digits are fix 321 other 7 are in different pairs.i want max pairs as i can made in different sheets with given pairs in sheet accordingly...

Nabeel
 

Attachments

  • couple sample.xlsx
    9.2 KB · Views: 6
UDF
=ReverseStr(A1,3)
Code:
Function ReverseStr(ByVal txt As String, ByVal myFix As Long) As String
    ReverseStr = Left$(txt, myFix) & StrReverse(Mid$(txt, myFix + 1))
End Function
 
sorry dear jindon..i want auto pair in like column A.i have give example in column A this is as i want..in column B i try to told, it can be also pair..
Nabeel
 
Still not sure about the logic.
Try
Code:
Sub test()
    Dim x, i As Long, ii As Long, a(), n As Long
    Const myFix As String = "321"
    x = Array(1, 2, 3)
    ReDim a(1 To 1000)
    For i = LBound(x) To UBound(x)
        For ii = 1 To 9
            n = n + 1
            If UBound(a) < n Then
                ReDim Preserve a(1 To UBound(x) + 1000)
            End If
            a(n) = myFix & String(3, CStr(x(i))) & String(3, CStr(ii))
        Next
    Next
    Cells(1).Resize(n).Value = Application.Transpose(a)
End Sub
 
In your example you have
3211111222 => 3212222111
Why isn't it ?
3211111222 => 3222222111
 
its generating only 27 numbers & working in silver number sheet only and after 321 only 6 digit it should be 7...
 
logic of this, we are making these type of number by hand for client .we need to do this exercise again and again and with different format and prefix which take lot of time.this is for telecom industry..
 
Can you please explain why on the Golden Numbers
3211111222 => 3212222111
Note the mid 4 x 1's change to 2

But on the Silver Numbers
3211222111 = > 3211111222
But here only 3 x 2's change to 1's
 
in all sheet 321 is standard ...if the 4 consecutive any numbers like,1111,2222,3333 so on we called Golden numbers.
if the 3 consecutive any numbers like,333,111,222 so on we called silver numbers.
if the 5 consecutive number we called plat numbers,

321 is standard code if the any number like 111 after 321.it will like 3211111.it will not called golden it will silver and similarly for others..
 
code can be 320,321,300 it will be standard codes..7 digit after this will show it is golden, silver or plat category
 
Hi Nabeel ,

Nothing is clear.

You have explained the meaning of Golden , Silver and Platinum numbers , but there is still no explanation of how these numbers are to be processed to get the numbers in column B.

I am attaching a file which has only the Golden numbers ; can you fill in the colored cells in column C ?

Narayan
 

Attachments

  • Book91.xlsx
    9.1 KB · Views: 1
Hi NARAYANK
i need this type of number in column A..column B is the reverse of column A which means that this also an golden number format..you can ignore column B for while..

Nabeel
 
NARAYANK brother

your sheet is good enough there is 72 combination of golden numbers these are exactly i want,if we reverse the format we will get another 72..like if B1 is 3212221111, 3213331111 and so on..
 
Hi ,

So what you are saying is that given the starting 3 digit prefix , we should generate all the Golden , Silver and Platinum numbers ?

Narayan
 
Nabeel

You have to assume we know nothing about what your doing
You have to explain it to us as if we know nothing
 
Last edited:
Hi Hui ,

It is now clear what he wants ; these are telephone numbers , which are known as Golden , Silver and Platinum numbers.

They are 10 digit numbers , where the first 3 digits are a prefix ; the remaining 7 digits can form a series of repeating digits ; if the series consists of a maximum of 3 repeating digits , the number is known as a Silver number ; if it contains a maximum of 4 repeating digits , it is a Golden number , and if it contains a maximum of 5 repeating digits , it is a Platinum number.

So , for example , suppose the prefix is 321 , then a number such as :

321 1222 111 will be a Silver number

321 1111 222 will be a Golden number

321 1122 222 will be a Platinum number

Nabeel wants that given the prefix of 321 , we should generate all possible Silver , Golden and Platinum numbers.

Narayan
 
Back
Top