View Single Post
  #11  
Old 10-30-2007, 11:36 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Random picking of hands from a database

[ QUOTE ]
OK, that .pdf totally worked.
A+++++


But I'd like to do this 30-40 times.
So I tried to make it a macro.
Write the results to column D (starting at cell D11).
Then insert a column so that it moves to the right and I can repeat.

This line is given as an error in my macro:
Application.Run "ATPVBAEN.XLA!Sample", ,ActiveSheet.Range("$D$11"), "R" _, 1000, True

I get Runtime Error 1004.
ATPVBAEN.XLA could no be found.

So it works onetime, but not in a macro...oh well beggars can't be choosers!

***********************
Sub Sampling1()
'
' Sampling1 Macro
' Macro recorded 10/30/2007 by wks46
'
' Keyboard Shortcut: Ctrl+s
'
Application.Run "ATPVBAEN.XLA!Sample", , ActiveSheet.Range("$D$11"), "R" _
, 1000, True
End Sub

[/ QUOTE ]
Did you also make sure that you installed the "Analysis ToolPak VBA" (see: http://www.cpearson.com/excel/ATP.htm ).

If it's not that then I'm not really sure (I'm afraid I don't know much about excel macros).

Juk [img]/images/graemlins/smile.gif[/img]
Reply With Quote