LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default Error for loop


Hi
I wrote a VBA to paint a color bar chart if more than 3 days.
Below is my code but it is not working, no painting,
Don't know why, need your help
Thanks
Daniel

----------------------------------------------------------------------------

Sub painting

Dim Rng7 as range
Dim Cnt7 as integer
Cnt7=1

For Each Rng7 In Range(.Cells(2, 6), .Cells(12, 6))
If Rng7.Value = "" Then
Exit For

'If IsEmpty(Rng7) Then
'not working if empty cell

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

Pts.HasDataLabel = True


If (DateDiff("d", Rng7, Now)) 3 Then

Pts.Fill.Patterned Pattern:=msoPatternDarkUpwardDiagonal

End If
Cnt7 = Cnt7 + 1

End If

Next Rng7
end sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
For..Next loop error Ian_Limbo Excel Programming 14 December 14th 04 05:49 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Error in loop Daniel Bonallack[_2_] Excel Programming 2 November 19th 03 07:10 PM
loop error Sam Excel Programming 0 September 25th 03 02:32 PM
loop error Sam Excel Programming 0 September 18th 03 02:19 PM


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"