Error data mismatch ??

D

Daniel

Hi

I am working on programing VBA to make PatternDarkUpwardDiagonal of my bar
chart if date in range Rng7 more than 3 days

But I have error of date mismatch of S

Below is my code

Need your help to figure out the problem

Thanks
Daniel

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Rng7 as range
Dim S as integer
Dim Cnt7 as integer

For Each Rng7 In Range(.Cells(2, 6), .Cells(20, 6))

Set Pts = ActiveChart.SeriesCollection(1).Points(Cnt7)

Pts.HasDataLabel = True


S = DateDiff("d", Now, Rng7.Value)


If S > 3 Then

Pts.Fill.Patterned Pattern:=msoPatternDarkUpwardDiagonal

End If
Cnt7 = Cnt7 + 1

Next Rng7
 
J

Joel

I tried to duplicate your error and can't get the same error message with
excel 2003. Tried with diffeent types of erros and only get an overflow
error. I also noticed you don't have Cnt7 set to any value.
 
D

Daniel

Dim Cnt7 as integer

Don't know that if i change
Rng7.Value to Rng7.dataseries will work or not

Thanks
Daniel
 
D

Daniel

Cnt7=1 was set

Joel said:
I tried to duplicate your error and can't get the same error message with
excel 2003. Tried with diffeent types of erros and only get an overflow
error. I also noticed you don't have Cnt7 set to any value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top