ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   This should be simple if I knew any better... (https://www.excelbanter.com/excel-programming/410890-should-simple-if-i-knew-any-better.html)

[email protected]

This should be simple if I knew any better...
 
So I want to make a every possible scenario sheet given the rows
(1,2,3,4...) and columns (a,b,c) listed below in sheet 1. I want to
make that into Sheet 2, eventually ending with the line on the bottom
there. Could you help me write a code that would do this for me?
This would be simple, except I don't know any better...

Thank you in advance!


Sheet 1
A B C
1 Andy Morning Baseball
2 Barry Breakfast Basketball
3 Carl Afternoon Football
4 David Lunch
Evening
Dinner


Sheet 2
A B C
1 Andy Morning Baseball
2 Andy Morning Basketball
3 Andy Morning Football
4 Andy Breakfast Baseball
5 Andy Breakfast Basketball
6 Andy Breakfast Football
7 Andy Afternoon Baseball

X Barry Morning Baseball
……..
XX David Dinner Football

RB Smissaert

This should be simple if I knew any better...
 
Sub test()

Dim a As Long
Dim b As Long
Dim c As Long
Dim r As Long
Dim arr

arr = Range(Cells(1), Cells(6, 3))

r = 7

For a = 1 To 4
For b = 1 To 6
For c = 1 To 3
r = r + 1
Cells(r, 1) = arr(a, 1)
Cells(r, 2) = arr(b, 2)
Cells(r, 3) = arr(c, 3)
Next c
Next b
Next a

End Sub


RBS


wrote in message
...
So I want to make a every possible scenario sheet given the rows
(1,2,3,4...) and columns (a,b,c) listed below in sheet 1. I want to
make that into Sheet 2, eventually ending with the line on the bottom
there. Could you help me write a code that would do this for me?
This would be simple, except I don't know any better...

Thank you in advance!


Sheet 1
A B C
1 Andy Morning Baseball
2 Barry Breakfast Basketball
3 Carl Afternoon Football
4 David Lunch
Evening
Dinner


Sheet 2
A B C
1 Andy Morning Baseball
2 Andy Morning Basketball
3 Andy Morning Football
4 Andy Breakfast Baseball
5 Andy Breakfast Basketball
6 Andy Breakfast Football
7 Andy Afternoon Baseball

X Barry Morning Baseball
……..
XX David Dinner Football



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com