Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Loop question

Posted on 2013-11-07
5
Medium Priority
?
206 Views
Last Modified: 2013-11-08
Hi Guys, I want to do a Loop down Column "BA" of my spreadsheet and if a Cell has Value in it to populate the same Cells in Columns "AD" & "AE" with the following comments "Non Validated  trade" and "Dashboard". The Previous Business Date has to be column AJ .How do I write the code for this?
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
5 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 39630579
i'd use if formula here , just much more natural to excel , just type "=if" in  "AD" & "AE"  and follow the instructions
0
 
LVL 35

Expert Comment

by:Norie
ID: 39630597
What does this mean?

The Previous Business Date has to be column AJ
0
 

Author Comment

by:Justincut
ID: 39630625
The Previous Business Date would be populated to the same row as where there's values in Column BA, eg. today it would populate "06/11/2013". I don't want a formula as this is a column where many commentaries must be written.
0
 
LVL 35

Expert Comment

by:Norie
ID: 39630647
Do you mean as well as putting values in AD and AE you want the previous business day in AJ?
0
 
LVL 12

Accepted Solution

by:
Harry Lee earned 2000 total points
ID: 39632156
Is this what you want?

Sub checkifvalue()
Dim I As Integer, WS As Worksheet, ADString As String, AEString As String, AJString As String

ADString = "Non Validated Trade"
AEString = "Dashboard"
AJString = Format(Application.WorksheetFunction.WorkDay(Now(), -1), "MM/DD/YYYY")
Set WS = ActiveSheet

For I = 2 To WS.Cells(Rows.Count, 53).End(xlUp).Row
    If IsNumeric(WS.Cells(I, 53)) Then
        WS.Cells(I, 30) = ADString
        WS.Cells(I, 31) = AEString
        WS.Cells(I, 36) = AJString
    End If
Next
Columns.AutoFit
End Sub

Open in new window

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

618 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