Solved

Do Loop question

Posted on 2013-12-23
3
134 Views
Last Modified: 2013-12-27
Hi Guys, I have a While...Wend Loop that loops down column 5 in a spreadsheet.how do I change the following code to add an Instring to the Loop. If I wanted to Loop down and look for the number "3588343" in a cell in column 5, how would I adapt the following code?


Sub Nonvalidated2()
Dim Prevday As String
Dim i As Integer
Worksheets("Rec").Select

'Prevday = WorksheetFunction.WorkDay(Date, -1)
i = 4


While Cells(i, 5).Value <> ""


ElseIf Cells(i, 8).Value = "3588343, 3587873" Then

Cells(i, 30).Value = "Manual Jnl - 1532952/jwils2 - REVERSE OPENING STD JOURNAL & 1646037/ikass - EUC - MONTHLY EIR POSTINGS FOR FV HEDGE STRUCTURES DE-DESIGNATED"
0
Comment
Question by:Justincut
  • 2
3 Comments
 
LVL 4

Expert Comment

by:andrew_man
ID: 39735917
Post your workbook here!
0
 

Author Comment

by:Justincut
ID: 39736003
0
 
LVL 4

Accepted Solution

by:
andrew_man earned 500 total points
ID: 39736031
InStr(1, Cells(i, 8).Value, "3588343") > 0
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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,…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

895 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

14 Experts available now in Live!

Get 1:1 Help Now