Solved

find text then copy a range

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel 2013 Problem 12 48
Excel- VBA help on macros that size columns and rows 7 21
VBA in SharePoint 3 19
Macro 3 21
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

746 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

9 Experts available now in Live!

Get 1:1 Help Now