Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 3-character combinations?

Excel 2003 SP3
Win XP SP2

Is there a quick way to generate a list of all possible 3-character
combinations using the alpha characters A-Z and the numbers 0-9?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default 3-character combinations?

Probably other ways, but here's one:

- Place A-Z in A1 to A26
- Place 0-9 in A27 to A36

Then you can use this code.

Sub test()

For cOne = 1 To 36
myCell1 = Range("A" & cOne).Value
For cTwo = 1 To 36
myCell2 = myCell1 & Range("A" & cTwo).Value
For cThree = 1 To 36
myCell3 = myCell2 & Range("A" & cThree).Value
Range("B" & Range("B65536").End(xlUp).Row + 1).Value = myCell3
Next cThree
Next cTwo
Next cOne

End Sub


HTH,
Paul

--

"Allison" wrote in message
...
Excel 2003 SP3
Win XP SP2

Is there a quick way to generate a list of all possible 3-character
combinations using the alpha characters A-Z and the numbers 0-9?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 3-character combinations?

This worked great. Thank you very much.

Allison

"PCLIVE" wrote:

Probably other ways, but here's one:

- Place A-Z in A1 to A26
- Place 0-9 in A27 to A36

Then you can use this code.

Sub test()

For cOne = 1 To 36
myCell1 = Range("A" & cOne).Value
For cTwo = 1 To 36
myCell2 = myCell1 & Range("A" & cTwo).Value
For cThree = 1 To 36
myCell3 = myCell2 & Range("A" & cThree).Value
Range("B" & Range("B65536").End(xlUp).Row + 1).Value = myCell3
Next cThree
Next cTwo
Next cOne

End Sub


HTH,
Paul

--

"Allison" wrote in message
...
Excel 2003 SP3
Win XP SP2

Is there a quick way to generate a list of all possible 3-character
combinations using the alpha characters A-Z and the numbers 0-9?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default 3-character combinations?

Please not that when it gets to the numbers that begin with zero, excel will
treat it as a number and automatically drop the zero.
So "012" would end up being "12". One way that could fix this is to format
column B as text before you run this code.

Glad I could help.
Paul

--

"Allison" wrote in message
...
This worked great. Thank you very much.

Allison

"PCLIVE" wrote:

Probably other ways, but here's one:

- Place A-Z in A1 to A26
- Place 0-9 in A27 to A36

Then you can use this code.

Sub test()

For cOne = 1 To 36
myCell1 = Range("A" & cOne).Value
For cTwo = 1 To 36
myCell2 = myCell1 & Range("A" & cTwo).Value
For cThree = 1 To 36
myCell3 = myCell2 & Range("A" & cThree).Value
Range("B" & Range("B65536").End(xlUp).Row + 1).Value =
myCell3
Next cThree
Next cTwo
Next cOne

End Sub


HTH,
Paul

--

"Allison" wrote in message
...
Excel 2003 SP3
Win XP SP2

Is there a quick way to generate a list of all possible 3-character
combinations using the alpha characters A-Z and the numbers 0-9?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - Formatting text in cell (character by character) TomC Excel Discussion (Misc queries) 0 January 29th 10 07:25 PM
Excel-Match 1st text character in a string to a known character? bushlite Excel Worksheet Functions 2 January 15th 07 06:36 PM
Creating character combinations out of a possible set... Dana DeLouis Excel Programming 0 January 5th 07 12:29 PM
importing undelimited text file data, character-by-character The Mos$ Excel Programming 4 December 26th 05 11:01 AM
Function to return Character Position of Xth character within a string Andibevan[_2_] Excel Programming 4 June 9th 05 03:24 PM


All times are GMT +1. The time now is 05:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"