dwmoh

New Member
Joined
Nov 13, 2017
Messages
3
Hello
in "feuil1" I have btn Draw when click in it I want to display the result in the feuil2 but there is an error in : "Range("E3").Resize(Tirag.Count) = Application.Transpose(Tirag.Items)"
******
Sub tirage()
Dim Tirag As Object
Dim Nbr As Long


Set Tirag = CreateObject("Scripting.Dictionary")
Sheets("Feuil2").Range("E3:E10").ClearContents
If Application.CountA(Sheets("feuil2").Range("A2:C2")) <> 3 Or [A2] > ([C2] - [B2] + 1) Then Exit Sub
While Tirag.Count < [A2]
Randomize Timer
Nbr = Int(([C2] - [B2] + 1) * Rnd + [B2])
Tirag(Nbr) = Nbr
Wend


Range("E3").Resize(Tirag.Count) = Application.Transpose(Tirag.Items)
End Sub



******
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Could you explain the purpose of the code, and typical values in A2/B2/C2?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,737
Messages
6,126,577
Members
449,318
Latest member
Son Raphon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top