LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Combo

It should be easy to work out - if you need help modifying the code, post back. And in any event,
let us know if you succeed or not.

HTH,
Bernie
MS Excel MVP


<Garrett S wrote in message ...
Thanks for the quick reply.

There are 5 attribute sheets in total, but I can modify your code, which looks promising!

Appreciate your input, I'll let you know how it works tomorrow.

Regards,

Garrett





Bernie Deitrick wrote:

Garrett,Is it always three sheets?
21-Jan-10

Garrett,

Is it always three sheets?

Let's say that you have your lists in column A of Sheet1, Sheet2, and Sheet3, and those are the
only
sheets in your workbook. All else is blank. Run the macro below.

HTH,
Bernie
MS Excel MVP

Sub MakeCombos()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim Sh1 As Worksheet
Dim Sh2 As Worksheet
Dim Sh3 As Worksheet
Dim Sh4 As Worksheet

Set Sh1 = Worksheets(1)
Set Sh2 = Worksheets(2)
Set Sh3 = Worksheets(3)
Set Sh4 = Worksheets.Add(After:=Sheets(3))

For i = 1 To Sh1.Cells(Rows.Count, 1).End(xlUp).Row - 1
Sh1.Cells(i + 1, 2).Value = "'" & Format(i, "00")
Next i
For i = 1 To Sh2.Cells(Rows.Count, 1).End(xlUp).Row - 1
Sh2.Cells(i + 1, 2).Value = "'" & Format(i, "00")
Next i
For i = 1 To Sh3.Cells(Rows.Count, 1).End(xlUp).Row - 1
Sh3.Cells(i + 1, 2).Value = "'" & Format(i, "00")
Next i

myC = 1
For i = 1 To Sh1.Cells(Rows.Count, 1).End(xlUp).Row - 1
For j = 1 To Sh2.Cells(Rows.Count, 1).End(xlUp).Row - 1
For k = 1 To Sh3.Cells(Rows.Count, 1).End(xlUp).Row - 1
myC = myC + 1
Sh4.Cells(myC, 1).Value = "'" & Format(i, "00") & _
"_" & Format(j, "00") & "_" & Format(k, "00")
Sh4.Cells(myC, 2).Value = Sh1.Cells(i + 1, 1).Value & _
"_" & Sh2.Cells(j + 1, 1).Value & "_" & Sh3.Cells(k + 1, 1).Value
Next k
Next j
Next i

End Sub

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Implementing Continuous Scrolling UI Pattern in ASP.NET
http://www.eggheadcafe.com/tutorials...tinuous-s.aspx



 
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
Permutations John[_33_] Excel Worksheet Functions 2 January 31st 10 09:49 PM
permutations art Excel Worksheet Functions 1 May 8th 09 05:07 PM
Permutations Dave Excel Discussion (Misc queries) 5 July 23rd 07 03:06 PM
Permutations RedChequer Excel Worksheet Functions 9 September 26th 05 03:14 AM
Permutations Henrik Excel Programming 3 December 2nd 04 05:32 AM


All times are GMT +1. The time now is 03:34 PM.

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

About Us

"It's about Microsoft Excel"