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: 18
Default Need help in VBA

I have an Excel file with several VBA inquiries, they are all working fine
except one.
This particular one, each time I execute it, it's adding the answer to the
one that was there before.

Have been searching and trying several thing for a few hours now, and I
think I will never find out why alone!
If you can please help me?

Thanks,

Sophie



Here's part of the code (it is repeated for 17 different rows and range).

---

Static Sub mPfait()

Range("M60,M57,M54,M51,M48,M45,M42,M39,M36,M33,M30 ,M27,M24,M21,M18,M15,M12").Select
Selection.ClearContents


Dim MyRange2001 As Range
Set MyRange2001 = Range("U12:BZ12")

Dim MyRange3001 As Range
Set MyRange3001 = Range("U2:BZ2")

For Each C In MyRange2001
If C.Interior.ColorIndex = 50 Then
For Each D In MyRange3001
If D.Column = C.Column Then
If D.Interior.ColorIndex = 38 Then
mytotal2001 = mytotal2001 + C
End If
End If
Next
End If
Next
Range("M12") = mytotal2001


 
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



All times are GMT +1. The time now is 10:40 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"