Forum Discussion
djk5214
Aug 06, 2021Copper Contributor
VBA / Macro / Spilled Array / StockHistory
Hi, I'm struggling to get a simple VBA macro to get data from a stockhistory spilled array. Please see screenshots. Basically, the stockhistory function runs fine manually outside of a macro. But ...
mathetes
Aug 06, 2021Silver Contributor
What is it that the macro does that STOCKHISTORY by itself won't do in your situation?
I ask as a person who avoids macros unless absolutely necessary (and that condition rarely arises). So you can take my question with a grain of salt if you're a true believe in macros, but please hear me when I say I've often seen the situation where people jump to macros far sooner than they need to. Excel's built-in functions are amazingly powerful.
djk5214
Aug 07, 2021Copper Contributor
The macro in the screenshot is just a basic script to show what my issue is. In actuality, I want to test my strategies on a hundred different stocks or so. So instead of me manually performing a stock history lookup on every single stock, I want a macro to automatically run through a list of stocks and collect data from each stockhistory lookup. That way, I just click "run" once and I get my list of data. It would save me a huge amount of time.
- djk5214Aug 07, 2021Copper ContributorAnd regardless of what I plan to use the macro for, I still would like to understand why this specific function does not want to work within a macro. This could have implications for a wide variety of uses. If the issue is with spilled arrays itself, then stockhistory isn't the only way to create a spilled array, and I'm sure others would like to know how to fix this issue as well.
- cmscmsleopoldoFeb 06, 2023Copper Contributor
your question was asked about a year and a half ago. I am experiencing exactly the same issue. Did you ever get a solution??
Regards
cmsleopoldo
- cmscmsleopoldoFeb 06, 2023Copper ContributorTo djk5214,
your question was asked about a year and a half ago. I am experiencing exactly the same problem. Did you ever get a solution??
Regards cmsleopoldo