spuppis
spuppis

Reputation: 1

Check seriescollection formula in Excel

I would like to check if seriescollection(1).formula is of expected string or .value of expected range, but anything I try always succeeds regardless of data like:

If graf.SeriesCollection(1).Formula = _ 
       Range("Podatki!$B$1:$C$97;Podatki!$K$1:$L$97") Then
            MsgBox ("1")
End If

If graf.SeriesCollection(1).Values = _ 
       Range("Podatki!$B$1:$C$97;Podatki!$K$1:$L$97") Then
            MsgBox ("2")
End If

Upvotes: 0

Views: 1287

Answers (1)

AnalystCave.com
AnalystCave.com

Reputation: 4974

Aren't you missing the Formula statement in this row (first row):

graf.SeriesCollection(1).Formula = Range("Podatki!$B$1:$C$97;Podatki!$K$1:$L$97") .Formula 

Similarly for values:

graf.SeriesCollection(1).Value2 = Range("Podatki!$B$1:$C$97;Podatki!$K$1:$L$97").Value2

Upvotes: 1

Related Questions