Solved

Do Loop not working

Posted on 2013-12-17
5
130 Views
Last Modified: 2013-12-19
Hi Guys, can anyone tell me why this piece of my code is not working ?

ElseIf Cells(i, 6).Value = "LDCFICOT1A" Then
Cells(i, 25).Value = "8631"
Cells(i, 30).Value = "Bond Pricing diff btw MX and GBO"


Cells(i, 31).Value = "IT Rec Issue - FO MTM on Bonds (MTM folder)"



Cells(i, 32).Value = "JC"
Cells(i, 34).Value = "3842"


Cells(i, 33).Value = "0"
Cells(i, 36).Value = "05/09/2011"
DummyRec8.xlsx
0
Comment
Question by:Justincut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39723574
Not working in what sense? (there isn't any code in that file)
0
 

Author Comment

by:Justincut
ID: 39723840
For some reason, its not populating those Cells. Here's the attachment with Macro.
DummyRec8.xlsm
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39723881
It's because the only row that matches that criterion also matches one of your previous If statements:
ElseIf Cells(i, 8).Value = "-3848015, -5132700, -4986040, -6783900, -6881113, -6764890, -6881026, -3862199, -3847999, -4984470" Then

so the line that populates the other cells is never executed.
0
 

Author Comment

by:Justincut
ID: 39725135
Cool! Can you tell me how you found out? Did you use the immediate window?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 39725476
I used a debug.assert to break the code when i hit the row number of interest, then stepped through to see what was being executed.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question