VBA Filtering and copy paste selected datas.

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,280
Office Version
  1. 2013
Platform
  1. Windows
Good Day,
Is it possible to filter multiple entries if one of the word similar on a cell?
Sample: Column F has datas all the way down every cell has different multiple words under common a word which will be match with CB1 cell.
The code given below filtering only match values I need to add additional function on that given code.
Thanks in advance.


VBA Code:
Dim LR As Long, i As Long
LR = Range("F" & Rows.Count).End(xlUp).Row
For i = 1 To LR
With Range("F" & i)
If .Value = Range("CB1").Value Then
.Offset(, -3).Resize(, 4).Copy
Range("CE" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
End If
End With
Next i
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Change this:
VBA Code:
If .Value = Range("CB1").Value Then

For this:
VBA Code:
If .Value Like "*" & Range("CB1").Value & "*" Then
 
Upvote 0
So I did not understand what you need.
Could you give examples of what you have in column F, what you have in cell CB1 and what you expect as a result.
If you help us with examples using the XL2BB tool it would be fantastic and that way the answers will be more effective.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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