ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   rnd (https://www.excelbanter.com/excel-programming/301759-rnd.html)

dallas

rnd
 
Sub myrandomize()
Dim rng As Range, rng1 As Range
Dim idex As Long

Set rng = Range("C3:J3")
Set rng1 = Range("C4:J4")
idex = Int(Rnd() * 8 + 1)
Range("F21") = Int((rng1(idex) - rng(idex) + 1) _
* Rnd + rng(idex))

End Sub


If one or more of Range
("C3:C4") ("D3:D4") ("E3:E4") ("F3:F4") ("G3:G4") ("H3:H4") ("I3:I4"
("J3:J4")
have no number how can I randomize only from the Range
("C3:C4") ("D3:D4") ("E3:E4") ("F3:F4") ("G3:G4") ("H3:H4") ("I3:I4"
("J3:J4")
that have number?


(There is always an number in both #3 and #4 if there is an number i
one of them)


/dalla

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com