Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
looping and stopping when a condition is met - test | Excel Discussion (Misc queries) | |||
7 function rule cont. | Excel Worksheet Functions | |||
Another Error Cont' | New Users to Excel | |||
CONT.IF and color condition? | Excel Discussion (Misc queries) | |||
stopping code from looping | Excel Worksheet Functions |