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
112 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 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