vba - Macro to export all n set of values combinations of x>n values of range -
To export a combination of several set values, I need a macro to export composites to set data sets of sets In comparison, there will be a smalar. For the exam, I can say that I need all 2 sets of values in the 3 categories of values in the data range.
Data ____ Exports
AB C____ AB AC Bc
BABB ABB BA
-
All values of the data will be in different cells but each time the comb value should be in each cell. Apart from this, export should be in the form of horizontal form.
This is a code that is a bit off for me on the Web, but I can not edit it to use it.
Enter the code Sub comb () as dim variants variant, long as variant dim lRow, I have long vElements = Application.Transpose (range ("A1 ", Range (" A1 "). End (xlDown)) column" C: Z "). For obvious lRow = 1, I am going to Ubound (Vietelment) redemption vresult (1 to i) call combinations (vElements, i, vresult, lRow, 1, 1) for I = 1, I end up with sub sub-combination NP (vElements, Long as P, variant as vresult, long as lRow, integer as iElement, integer as iIndex) i = iElement for long time vEllments (iEndex) = vElements (I) if iIndex = P LRow = lRow + 1 range ("C" & amp; lRow) Repeat (, p) = vresult or call collation NP (Vietelment, P, vresult, lRow, i + 1, iIndex + 1) End if next I n P> I wonder Whether using a new sheet / range with cell references was more convenient
((= Sheet1! $ A1 and amp; Sheet1! B1)) If it is three rows, copy sub sub export_01 ()
dim aStart, aExport given as an Aro
aro = ActiveSheet.Range ("A65536"). End (XLEEP) .Rost = 1 for one export = 5 I = 1 one line cells (i, aExport). Value = cell (i, aStart) & amp; Cell (i, aStart + 1) cell (i, aExport + 1). Price = Room (i, aStart) & amp; Room (i, aStart + 2) Room (i, aExport + 2). Price = Room (i, aStart + 1) & amp; Cell (i, aStart + 2) Next I
End Sub ()
Comments
Post a Comment