Superb Excellent Macro needs minor tweaking: HELP PLEASE!

shuga

New Member
Joined
Aug 25, 2015
Messages
30
Hi everyone,


Good day to you all.


A couple days ago, a kind sir by the name Mike Rickson gave me a macro to extrapolate a set of random numbers from a given range of numbers from column A:1 all the way to A:49 sitting on 49 rows.


At the moment i am concerned for his wellbeing because he is not responding to my messages, hence i need to seek elsewhere for now.


The macro provided gave me a choice to extrapolate and fit the results into columns BCDE or more and a 100 rows or more for each of these columns. The code is pasted below.


Now i would like to work with these set of numbers instead, ranging from Column A:1_1 to A:49_49 sitting on 2401 rows in length.
E.g 1_1, 1_2, 2_4, 11_28, 31_45, all the way to 49_49... these gives us 2401 rows in length on column A.


Please look at the code and adjust as requested.




Sub test()
Dim Size As Long, inCount As Long
Dim numberChosen As Long
Dim RandIndex As Long
Dim rngData As Range, rngOut As Range
Dim inArray As Variant, outArray() As Long
Dim i As Long, j As Long

Set rngData = Range("A1").Resize(49, 1)
Set rngOut = Range("B1")
inArray = rngData.Columns(1).Value
inCount = UBound(inArray, 1)

numberChosen = Application.InputBox("how many to return", Default:=4, Type:=1)
If numberChosen < 1 Then Exit Sub: Rem cancel pressed
Size = Application.InputBox("how many to return", Default:=100, Type:=1)
If Size < 1 Then Exit Sub: Rem canceled

ReDim outArray(1 To Size, 1 To numberChosen)
For i = 1 To Size
For j = 1 To numberChosen
outArray(i, j) = inArray(WorksheetFunction.RandBetween(1, inCount), 1)
Next j
Next i

With rngOut.Resize(Size, numberChosen)
.EntireColumn.ClearContents
.Value = outArray
End With
End Sub




Thanking you in advance.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
are you saying you want the UNDERSCORE to be part of the Number ?

At the moment i am concerned for his wellbeing because he is not responding to my messages, hence i need to seek elsewhere for now.

I won't respond to private messages, the forum is generally about excel, and not about having a personal private resource
 
Upvote 0
Honestly, I haven't tried, I wouldn't know how to manipulate a NUMBER that isn't a NUMBER, and make it work as a NUMBER
 
Upvote 0
a letter is still not mathmatical
 
Upvote 0

Forum statistics

Threads
1,217,332
Messages
6,135,947
Members
449,974
Latest member
riffburn

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