Solved

How to Loop a column to find a company name, take its Drawn Value and copy and paste to another tab

Posted on 2014-11-11
3
110 Views
Last Modified: 2014-11-19
Hi Guys, if you look at the attachment,in the "WTD commentary" tab, I have to populate column E with the "Drawn" balance of the companies in column B from the other tab "Daily GSFI PL" but in the column I. How can I create a Loop to do this in VBA code where it Loops down Column B from the tab "Daily GSFI PL, takes the data 8 columns along, copies and pastes it to the appropriate company in the WTD commentary tab and populates Column E "the Market Value" column?

Justin
Book3.xls
0
Comment
Question by:Justincut
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 500 total points
ID: 40436125
See attached file
Book3.xls
0
 

Author Comment

by:Justincut
ID: 40436222
I know how to use a Vlookup. The other tab is on another Excel File which I only get by opening an e-mail attachment, and I activate by using this Function:
Sub SelectMatchingWindow(MatchingFilename As String)

Dim NumberOfWindows As Integer
Dim Count1 As Integer
Dim MatchedWindowNumber As Integer
Dim WindowName As String

NumberOfWindows = Windows.Count

For Count1 = 1 To NumberOfWindows

    WindowName = Windows(Count1).Caption
   
    If InStr(WindowName, MatchingFilename) = 1 Then
        MatchedWindowNumber = Count1
    End If

Next Count1

If MatchedWindowNumber > 0 Then
    Windows(MatchedWindowNumber).Activate
End If



End Sub

Any ideas?
0
 

Author Comment

by:Justincut
ID: 40452941
I've requested that this question be deleted for the following reason:

Noone is answering the question
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

Suggested Solutions

Title # Comments Views Activity
excel pivot question 4 40
Excel Formula 4 28
splitting text of cell to columns 14 24
Error in formula not increasing value 2 15
A short article about problems I had with the new location API and permissions in Marshmallow
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

17 Experts available now in Live!

Get 1:1 Help Now