Develop a loop based on a tables characteristics

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
I need assistance to develop a loop based on these 2 tables below.
The first row contains the values that will repeat along the table.

For the first table each value will repeat 04 times.
For The second table the values will repeat 05 times.

Table01
ABCDEFGHIJKLMNO
AB-DEF-HI-KL-N-
-BCD-F-HIJ-LMN-
--CD-FG-IJKLM-O
A--DE-G-IJKL-NO
ABC-E-GH--K-MNO
ABC-EFGH-J--M-O

<tbody>
</tbody>

table02
PQRSTU
P-RSTU
-QRSTU
PQ-STU
PQR-TU
PQRS-U
PQRST-

<tbody>
</tbody>

The result will be the values from Table01 and Table02. 15 distinct values in each row.

Results
ABDEFHIKLNPRSTU
BCDFHIJLMNQRSTU
CDFGIJKLMOPQSTU
ADEGIJKLNOPQRTU
ABCEGHKMNOPQRSU
ABCEFGHJMOPQRST

<tbody>
</tbody>
 
Thanks for your support.
To simplify:
- 1st loop will always repeat 04 times the value of a total of 06 interations. The values starts from Column "A1" to column "O1".
- 2nd loop will always repeat 05 times the value of a total of 06 interations. The values starts from Column "R1" to column "X1".

Ps.: I just need the combination of both loops. Meaning a table with 15 columns and 06 rows where there is no repetition of values between the columns of the same row.
Example:
B C D F H I J L M N Q R S T U
C D F G I J K L M O P Q S T U
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Guys, how can I change the code below instead fill the cells by leaping the rows the code do the same but leaping by columns in a total of 10 rows.

<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Dim x As Long, y As Long, z As Long

FillColumns()
With
Sheet1 'Change accordingly
For y = 1 To 15
z
= 0
Do While z < 4
x
= Int((7 - 2 + 1) * Rnd + 2)
If .Cells(x, y) <> .Cells(1, y) Then
.Cells(x, y) = .Cells(1, y)
z
= z + 1
End If
Loop
Next y
End With
End Sub
</code>
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,553
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top