Solved

Do Loop not working

Posted on 2013-12-17
5
95 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
  • 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now