I want to be able to get results from a series of out put cells on my worksheets when I run a monte carlo simulation.
The starting point is a UserForm that has a RefEdit control. It works fine if I want to process only one out put but I am having trouble if I want more than that. I realise I could add a second RefEdit control etc but the problem with that approach is I do not know how many outputs I want.
I have tried this approach in change, after update and exit on the form.
Private Sub RefEdit1_AfterUpdate() Set SelRangeV = Range(RefEdit1) ‘Sets Range to Cell Selected Response = MsgBox(“Any More Outputs”, vbYesNo) ‘Any More Outputs Set SelRangeArr(RngCnt) = SelRangeV ‘Sets Cell Address to the Array for Outputs If Response = “vbyes” Then RngCnt = RngCnt + 1 End If ReDim Preserve serangearr(RngCnt) End Sub
That does not work. I have tried the same code in a Module, and while that does result in the msgbox appearing for the response when I click on yes the user form disappears.
As can be seen I was hoping to use the same RefEdit control for each output.
Any suggestions greatly appreciated.
Thanks
Peter