LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default looping and stopping cont

sorry that the previous post was truncated. i had composed a whole
explanation of the problem only to have the system go down on me. wanted to
make sure that it was working before i began the explantion again.

i have a macro that does the following.
1. goes to a cell in Col T (which contains the name of a project)
2. evaulates the contents, if the cell = General Research
3. go 16 columns to the left and put in MIT0001 (16 col to left is for the
donor's name)
4. go to the next row

as you can see by my macro, there are other projects than General research
and other donors than MIT.

THIS IS WHAT I WANT THE MACRO TO ALSO DO
1. Put the amount of funding by a donor in a cell - say AE1 for Donor X,
AF1 for Donor Y, etc
2. The expense amounts for the project are in Col Z
3. keep a running total of Col Z that are associated with the donor's name
in the donor name col
4. when the expenses than the amount in cell AE1, put in the next donor
(if there is one)
4. if have no other donor for this project, put in UNRESTR

i am including the part of the macro that works. any help or suggestions
that you can make would be really appreciated.

thanks in advance
Sub loopthroughnamesonly()
Dim C As Range
Dim D As Range
Dim MyRange As Range
Dim myRow As Integer
myRow = 618
Set MyRange = Range("T618:T1387")
For Each C In MyRange
If C.Value = "Karlan General Research" Then
C.Offset(0, 16).Value = "WBK0000"
ElseIf C.Value = "Karlan-Gine" Then
C.Offset(0, 16).Value = "WBK0000"
ElseIf C.Value = "MIT-JPAL:Udaipur Health" Then
C.Offset(0, 16).Value = "MIT0000"
ElseIf C.Value = "MIT-JPAL:Pratham Information" Then
C.Offset(0, 16).Value = "NBE0001"
ElseIf C.Value = "MIT-JPAL:Udaipur Health" Then
C.Offset(0, 16).Value = "NBE0001"
ElseIf C.Value = "Project Grad" Then
C.Offset(0, 16).Value = "PRJ0001"
ElseIf C.Value = "PRISMA - Trust" Then
C.Offset(0, 16).Value = "WES0001"

End If

ActiveCell.Offset(1, 0).Select
myRow = myRow + 1
Next
'Next
End Sub


--
aprilshowers
 
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
looping and stopping when a condition is met - test april Excel Discussion (Misc queries) 1 October 21st 09 11:36 PM
7 function rule cont. Helpme Excel Worksheet Functions 1 December 29th 06 01:45 PM
Another Error Cont' DavidB New Users to Excel 6 November 23rd 06 01:52 AM
CONT.IF and color condition? Fecozisk Excel Discussion (Misc queries) 2 May 1st 06 05:20 PM
stopping code from looping tjb Excel Worksheet Functions 3 December 7th 05 02:02 AM


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