habe einen Bereich in einem Tabellenblatt (W3:W17) mit Zahlen.
Nun möchte ich gern per Marko einer Variablen x - Zufällig eine der Zahlen aus dem Bereich übergeben...
wie lautet da richtige Code für ?!
Gruß und vielen Dank !
Kay
Option Explicit
Sub test()
Dim x As Long, Y As Long
For Y = 1 To 10000000
x = Int((17 - 3 + 1) * Rnd + 3)
'MsgBox x
If x > 17 Then MsgBox x: Exit For
Next
'MsgBox x
End Sub
Wenn ich einen Denkfehler habe, bitte klärt mich auf. Dim X As Long
X = Int((17 - 3 + 1) * Rnd + 3)
MsgBox Cells(X, 23) '23 = Spalte W
Gruß Tino
Sub test()
Dim x As Long
x = Int((17 - 3 + 1) * Rnd + 3)
MsgBox cells(x,23)
End Sub
Sub test()
Dim x As Long
x = Int((17 - 3 + 1) * Rnd + 3)
MsgBox cells(x,23)
End Sub