Searching and extracting data within a defined dataset

  • Thread starter Thread starter Ben Burns
  • Start date Start date
B

Ben Burns

Hello

I'm trying to write some vba code to do the following, and would
appreciate any help/advice.

Within a predefined dataset (Range A3:H1000), run a conditional search
to find rows with a specific number in column B and a specific text
string in column F. If those two criteria are met, copy cells in
column E and H to the first blank row in another worksheet. Iterate
for all populated rows in the range.

Many thanks
Ben
 
turn on the macro recorder and apply an autofilter to this range. Apply
filter criteria to columns B and F then remove the filter.

Now turn off the macro recorder and look at the recorded code.

In the section after the filter is applied, add code like

Activesheet.Autofilter.Range.copy Destination:= _
worksheets("Sheet2").Range("A1")
 
turn on the macro recorder and apply an autofilter to this range. Apply
filter criteria to columns B and F then remove the filter.

Now turn off the macro recorder and look at the recorded code.

In the section after the filter is applied, add code like

Activesheet.Autofilter.Range.copy Destination:= _
worksheets("Sheet2").Range("A1")

Many thanks Tom. Simple solution really!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top