hi
how can i get random numbers
between 34.01 and 33.99 i need at least 25 numbers
thanks
hi
how can i get random numbers
between 34.01 and 33.99 i need at least 25 numbers
thanks
lookup RandBetween in Excel Help. This will give you a start until someone comes along.
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Try:
=RAND()*(34.01-33.99)+33.99
...entered as an array.
Good reading: http://www.cpearson.com/excel/randomNumbers.aspx
thanks
hi
i need some help with a macro.
in sheet1 cell b1 the user enters the upper number in cell b2 the user enters the lower number and in cell b3 the user enters the number of how much random numbers needed
the macro that i need for random between two numbers
thanks for the help
Oleg,
Could you stick with your original thread on this?
Mark
Tell me how and I will do this
Threads merged.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Hi guy
try this !!
Hi Yasser,
Try to avoid looping, it slows down your code
[VBA]
Sub Test()
Dim rng1, cell, R1, R2 As Range
Dim cel As Range
Set cel = Selection
Set R1 = ActiveSheet.Range("B1")
Set R2 = ActiveSheet.Range("B2")
Set R3 = ActiveSheet.Range("B3")
Set rng1 = Range(Cells(1, "C"), Cells(R3, "C"))
Application.ScreenUpdating = False
Columns("C:C").ClearContents
With rng1
.Formula = "=Randbetween(" & R1 & "," & R2 & ")"
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
cel.Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
hi
how can i get it to work?
hi
i can not use numbers with decimal places for example
i need 20 numbers between 34.01 and 33.99
this not working
thanks for your help
There is only one whole number, I believe, between 34.01 and 33.99. Can you post a list which might be randomly generated which meets your criteria?Originally Posted by oleg_v
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
hi
i column E you can see the results that was generated by the formula:
=RAND()*(34.01-33.99)+33.99
That is what you asked for in Post 1. What answer are you expecting, as per my last question?
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
i need a macro to do this.
for the user that will enter the desirable borders and by
pressing the button he will get the results.
thanks
I cannot assist if you do not answer the questions I have asked.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Try this
I think the solution of array formulas is the best
Generally here's the code
Sub Test() Dim rng1, cell, R1, R2 As Range Dim cel As Range Set cel = Selection Set R1 = ActiveSheet.Range("B1") Set R2 = ActiveSheet.Range("B2") Set R3 = ActiveSheet.Range("B3") Set rng1 = Range(Cells(1, "C"), Cells(R3, "C")) Application.ScreenUpdating = False Columns("C:C").ClearContents With rng1 .Formula = "=RAND()*(" & (R1 - R2) + R2 & ")" .Copy .PasteSpecial Paste:=xlPasteValues End With cel.Select Application.CutCopyMode = False Application.ScreenUpdating = True End Sub
Try
[vba]
Sub Test()
Dim rng1, cell, R1 As Double, R2 As Double, R3 As Long
R1 = ActiveSheet.Range("B1").Value2
R2 = ActiveSheet.Range("B2").Value2
R3 = ActiveSheet.Range("B3").Value2
Application.ScreenUpdating = False
Columns("C:C").ClearContents
With Range("C1").Resize(R3)
.Formula = "=RAND()*(" & R2 & "-" & R1 & ")+" & R1
.Value = .Value
End With
Application.ScreenUpdating = True
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber