Solved

find text then copy a range

Posted on 2014-12-22
2
52 Views
Last Modified: 2014-12-22
Hello experts. not been able to find the exact code I need so looking for your help, again

I need to find the word Counterparty Code in column A and then from that point copy A-D to the last cell that is not blank

so if Counterparty Code is found in A7 and the last non-blank cell is A200 I need to copy the range A7 to D200

many thanks
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 40512795
Perhaps.
Dim Res As Variant

    Res = Application.Match("Counterparty Code", Columns(1), 0)

    If Not IsError(Res) Then
        Range("A" & Res, Range("A" & Rows.Count).End(xlUp)).Resize(,4).Copy
    End If

Open in new window

0
 

Author Closing Comment

by:Jagwarman
ID: 40512995
many thanks Have a great Christmas and New Year
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

806 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