code snippet:
If Range("ReportDate").Text = Range("Milestone_1st").Text Then
ActiveWorkbook.Names.Add Name:="PassedAsOf_1st", RefersToR1C1:="=" & Range("TotalPassed").Text
ElseIf Range("ReportDate").Text = Range("Milestone_2nd").Text Then
ActiveWorkbook.Names.Add Name:="PassedAsOf_2nd", RefersToR1C1:="=" & Range("TotalPassed").Text
...
what is working:
- referencing range values for report date and milestone date. Those are both referencing date fields on the spreadsheet. With my data it takes me to the Elseif statement.
problem: I get a 1004 error when it executes that statement.
THe syntax appears to be ok- I can replace
& Range("TotalPassed").Text
with
&"55"
...and that works.
Its just a problem with the reference to the named range TotalPassed
The name exists and can be referenced by a formula within a cell on the spreadsheet.
But in the watch window it shows method range of object global failed for Range("TotalPassed").Text
TotalPassed is defined with a GetPivotData command, so maybe Text property doesnt apply? Here is that definition:
=GETPIVOTDATA("Count",'Details by Test Case Category'!$A$3,"Status","Passed")
I am investigating object browser and web resources based upon that premise...so far a few variations of syntax and using Value instead of txt dont work.
any help? thank you in advance!
oh- and I am using Excel2007
If Range("ReportDate").Text = Range("Milestone_1st").Text Then
ActiveWorkbook.Names.Add Name:="PassedAsOf_1st", RefersToR1C1:="=" & Range("TotalPassed").Text
ElseIf Range("ReportDate").Text = Range("Milestone_2nd").Text Then
ActiveWorkbook.Names.Add Name:="PassedAsOf_2nd", RefersToR1C1:="=" & Range("TotalPassed").Text
...
what is working:
- referencing range values for report date and milestone date. Those are both referencing date fields on the spreadsheet. With my data it takes me to the Elseif statement.
problem: I get a 1004 error when it executes that statement.
THe syntax appears to be ok- I can replace
& Range("TotalPassed").Text
with
&"55"
...and that works.
Its just a problem with the reference to the named range TotalPassed
The name exists and can be referenced by a formula within a cell on the spreadsheet.
But in the watch window it shows method range of object global failed for Range("TotalPassed").Text
TotalPassed is defined with a GetPivotData command, so maybe Text property doesnt apply? Here is that definition:
=GETPIVOTDATA("Count",'Details by Test Case Category'!$A$3,"Status","Passed")
I am investigating object browser and web resources based upon that premise...so far a few variations of syntax and using Value instead of txt dont work.
any help? thank you in advance!
oh- and I am using Excel2007