Make Find, Copy, Paste Macro Find More than One Search Term

JamesA11

New Member
Joined
Oct 2, 2020
Messages
18
Office Version
  1. 2019
Platform
  1. Windows
Hello

I am using this macro to find, copy and paste rows where column E contains 0.1. I would like to adapt it so it also finds, copies, pastes rows where column E contains 0.11, 0.12, 0.13.

How do I amend it to make it work?

Thanks

VBA Code:
Option Explicit

Sub ParseData()

Dim Cell As Range

With Sheets("ResultsData")
    ' loop column E untill last cell with value (not entire column)
    For Each Cell In .Range("E1:E" & .Cells(.Rows.Count, "E").End(xlUp).Row)
        If Cell.Value = "0.1" Then
             ' Copy>>Paste in 1-line (no need to use Select)
            .Rows(Cell.Row).Copy Destination:=Sheets("ParsedData").Rows(Cell.Row)
        End If
    Next Cell
End With

End Sub
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try recording code that:

Applies a filter to sheet ResultsData
Filters column E for values between 0.11 and 0.13
Select the visible data range (Using Select Special to only select the visible cells)
Copy and Paste to ParsedData
Remove the filter from ResultsData

Review the recorded code, make any adjustments, then post back here if still stuck.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,588
Messages
6,120,409
Members
448,959
Latest member
camelliaCase

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top