Hi There
I have had my head in C# for a couple of years and my Excel VBA is a bit rusty! Here are my questions:
(1) I want to copy a range to an array of doubles, do some work, then copy the array back into the range ... but the only way I can seem to get it working is if I use a variant to store my data:
Dim myArray as Variant
'Range to Array
myArray = myRange.Value
' ** Do Work **
'Array to Range
myRange.Resize(UBound(myArray, 1), UBound(myArray, 2)).Value = myArray
Is there any way to copy a range to an array of doubles ? I am working with numbers so it is always doubles in the range
(2) How do I bulk copy an array of variants to an array of doubles ? (Without having to iterate through every element in the variant array and convert them to a doubles)
(3) In C# if statements, I can write:
if (condition1 && condition2)
{
//Do work here
}
And I know that the conditions are always evaluated left to right. Also, I know that if condition1 evaluates false, then condition two will not be evaluated.
Does the same thing occur in Excel VBA ?
Thanks
Orekin
I have had my head in C# for a couple of years and my Excel VBA is a bit rusty! Here are my questions:
(1) I want to copy a range to an array of doubles, do some work, then copy the array back into the range ... but the only way I can seem to get it working is if I use a variant to store my data:
Dim myArray as Variant
'Range to Array
myArray = myRange.Value
' ** Do Work **
'Array to Range
myRange.Resize(UBound(myArray, 1), UBound(myArray, 2)).Value = myArray
Is there any way to copy a range to an array of doubles ? I am working with numbers so it is always doubles in the range
(2) How do I bulk copy an array of variants to an array of doubles ? (Without having to iterate through every element in the variant array and convert them to a doubles)
(3) In C# if statements, I can write:
if (condition1 && condition2)
{
//Do work here
}
And I know that the conditions are always evaluated left to right. Also, I know that if condition1 evaluates false, then condition two will not be evaluated.
Does the same thing occur in Excel VBA ?
Thanks
Orekin