I need VBA Script Help.

chatz86

New Member
Joined
Feb 1, 2013
Messages
2
Hello.

i have my list of order and i want it convert it into a specific set of code.

OOGO1.O1.13Size
3031323334363840Total
322330431016
34012112119
Total2451552125

<colgroup><col><col><col><col><col span="2"><col><col><col span="4"></colgroup><tbody>
</tbody>

The above i want it to be converted into:

Complete codeQuantity
OOGO1.O1.13.30.322
OOGO1.O1.13.30.340
OOGO1.O1.13.31.323
OOGO1.O1.13.31.341
And so on…

<colgroup><col><col></colgroup><tbody>
</tbody>


Thank you so much in advance.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Sheet1

*ABCDEFGHIJ
1OOGO1.O1.13Size********
2*3031323334363840Total
3322330431016
434012112119
5Total2451552125

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:125px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4


the configuration o
f data should be like the above only
now try this macro

Code:
Sub test()
Dim endrow As Integer, result As Range
Dim size1 As Range, c1 As Range, size2 As Range, c2 As Range
Set size1 = Range(Range("B2"), Range("B2").End(xlToRight))
Set size2 = Range(Range("a3"), Range("a3").End(xlDown).Offset(-1, 0))
Range(Range("A3").End(xlDown).Offset(1, 0), Cells(Rows.Count, "A")).EntireRow.Delete


endrow = Cells(Rows.Count, "A").End(xlUp).Row
Set result = Cells(endrow, "A").Offset(5, 0)
'MsgBox result.Address
result = "complete code"
result.Offset(0, 1) = "quantity"
For Each c1 In size1
For Each c2 In size2
Set result = Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
result = Range("A1") & "." & c1 & "." & c2
result.Offset(0, 1) = Intersect(Columns(c1.Column), Rows(c2.Row))
Next c2
Next c1


End Sub
 
Upvote 0
No, you don't. Need code that is. {grin}

Suppose your data are in D2:N6. Suppose you want the result in B8:E8 on down.

Then, enter the following formulas:
B8: =INDEX($F$3:$M$3,INT((ROW()-ROW($C$8))/2)+1)
C8: =INDEX($E$4:$E$5,MOD(ROW()-ROW($C$8),2)+1)
D8: =$D$2&"."&B8&"."&C8
E8: =INDEX($F$4:$M$5,MOD(ROW()-ROW($C$8),2)+1,INT((ROW()-ROW($C$8))/2)+1)

Copy B8:E8 as far down as necessary (go too far and you will get error results in the cells).


Hello.

i have my list of order and i want it convert it into a specific set of code.

OOGO1.O1.13Size
3031323334363840Total
322330431016
34012112119
Total2451552125

<colgroup><col><col><col><col><col span="2"><col><col><col span="4"></colgroup><tbody>
</tbody>

The above i want it to be converted into:

Complete codeQuantity
OOGO1.O1.13.30.322
OOGO1.O1.13.30.340
OOGO1.O1.13.31.323
OOGO1.O1.13.31.341
And so on…

<colgroup><col><col></colgroup><tbody>
</tbody>


Thank you so much in advance.
 
Upvote 0
I guess you don't really need anything, ;), except maybe whatever's most convenient for the job in hand
Code:
Sub arrange()
Dim a, arr, d&, i&, j&
a = Range("A1").CurrentRegion
d = 2
For j = 2 To UBound(a, 2)
    For i = 3 To UBound(a, 1) - 1
        d = d + 1
        arr = Array(a(1, 1), a(2, j), a(i, 1))
        Cells(d + 6, 1) = Join(arr, ".")
        Cells(d + 6, 2) = a(i, j)
    Next i
Next j
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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