Solved

find text then copy a range

Posted on 2014-12-22
2
54 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

726 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