D
Dennis
I have a spreadsheet with 4000 rows. I choose 50 of those rows using the excel
random number generator as in:
LastRow = Sheets(OS).Cells(Rows.Count, "a").End(xlUp).Row
LastCol = Sheets(OS).Range("A2").End(xlToRight).Column
N= LastRow
For lj = 1 To 50
ll = Int(N * Rnd) + 1
lRndRows(lj) = ll
Next lj
How would I set the range as in:
Dim rng As Range
Dim myCell As Range
Dim curwk As Worksheet
OS = ActiveSheet.Name
Set curwk = Sheets(OS)
With Curwk
Set rng=?????
end with
to those 50 rows?
Thanks for any help
Dennis
random number generator as in:
LastRow = Sheets(OS).Cells(Rows.Count, "a").End(xlUp).Row
LastCol = Sheets(OS).Range("A2").End(xlToRight).Column
N= LastRow
For lj = 1 To 50
ll = Int(N * Rnd) + 1
lRndRows(lj) = ll
Next lj
How would I set the range as in:
Dim rng As Range
Dim myCell As Range
Dim curwk As Worksheet
OS = ActiveSheet.Name
Set curwk = Sheets(OS)
With Curwk
Set rng=?????
end with
to those 50 rows?
Thanks for any help
Dennis