Hi All
I have another issue. I have created a VBA code to randomly select 10 rows in a population of 46000 rows. The could looks as follows
Dim lRowNum(9) As Long, lCnt As Long, lrow As Long, i As Long
Do While lCnt < 10
lrow = Int(Selection.CurrentRegion.Rows.Count * Rnd + 1)
If Not IsNumeric(Application.Match(lrow, lRowNum, 0)) Then
lRowNum(lCnt) = lrow
lCnt = lCnt + 1
End If
Loop
Rows(1).Copy Sheets("Transaktions random kunder").Range("A1")
For i = LBound(lRowNum) To UBound(lRowNum)
Rows(lRowNum(i)).EntireRow.Copy Sheets("Transaktions random kunder").Range("A" & Sheets("Transaktions random kunder").Range("A" & Rows.Count).End(xlUp).Row + 1)
Next i
I have that issue, that i would like the 10 random rows to be based on a criteria in column AF. The column AF contains to different outcomes. Higher or Normal. Then i would like the rows to be 5 random rows with normal in AF column and the rest Higher in AF column.
Could Anyone help????
Thanks!
I have another issue. I have created a VBA code to randomly select 10 rows in a population of 46000 rows. The could looks as follows
Dim lRowNum(9) As Long, lCnt As Long, lrow As Long, i As Long
Do While lCnt < 10
lrow = Int(Selection.CurrentRegion.Rows.Count * Rnd + 1)
If Not IsNumeric(Application.Match(lrow, lRowNum, 0)) Then
lRowNum(lCnt) = lrow
lCnt = lCnt + 1
End If
Loop
Rows(1).Copy Sheets("Transaktions random kunder").Range("A1")
For i = LBound(lRowNum) To UBound(lRowNum)
Rows(lRowNum(i)).EntireRow.Copy Sheets("Transaktions random kunder").Range("A" & Sheets("Transaktions random kunder").Range("A" & Rows.Count).End(xlUp).Row + 1)
Next i
I have that issue, that i would like the 10 random rows to be based on a criteria in column AF. The column AF contains to different outcomes. Higher or Normal. Then i would like the rows to be 5 random rows with normal in AF column and the rest Higher in AF column.
Could Anyone help????
Thanks!