ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA problem pulling data out of variant/range input variables (https://www.excelbanter.com/excel-programming/326911-vba-problem-pulling-data-out-variant-range-input-variables.html)

[email protected]

VBA problem pulling data out of variant/range input variables
 
I have a VBA function that takes a named range as an input. The range
contains formulas with links to real-time fields. In the first line of
the function, I pull out the values field of the range: x =
InputX.Values (or x = InputX.Values2; both produce the same problem).
Usually this returns a Variant with the values in the range, but
occasionally it returns a Variant with empties in all the fields. Any
ideas what's causing this and how to prevent it?

Thanks,
Marc


Tom Ogilvy

VBA problem pulling data out of variant/range input variables
 
what you show is a variable that references a range.

a named range named InputX would be

x = Range("InputX").Value

probably just a terminology thing.

I have never seen it return a range of empties, but I recall seeing a
knowledge base article which alluded to a problem with dates I believe in
this situation, but I don't know if it matches your situation and I can't
find the article. (sorry).

--
Regads,
Tom Ogilvy

wrote in message
oups.com...
I have a VBA function that takes a named range as an input. The range
contains formulas with links to real-time fields. In the first line of
the function, I pull out the values field of the range: x =
InputX.Values (or x = InputX.Values2; both produce the same problem).
Usually this returns a Variant with the values in the range, but
occasionally it returns a Variant with empties in all the fields. Any
ideas what's causing this and how to prevent it?

Thanks,
Marc




[email protected]

VBA problem pulling data out of variant/range input variables
 
Hi Tom,

The different terminology didn't fix it. The really odd thing is that
I pass in several different range variables, and the problems only
happens for two of them. Those two ranges have formulas in them that
ultimately depend on a live bloomberg feed, so I'm guessing that has
something to do with it. In any case, the exact same code worked
yesterday, but not today...

The last time this happened the only way I could fix it was to delete
the named range and all the formulas, and then repopulate them...



All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com