copy & past if the cell contain symbol or values in specific column

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,429
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hello
i search way to copy and past in column b when match the data from e2:q with column a if the values matces then copy an paste in col b as my picture
اs(1).xlsx
ABCDEFGHIJKLMNOPQ
1VALU1VALUE2VALVALVALVALVALVALVALVALVALVALVALVALVAL
2OOOOOO1231234677IIUUOOOKLVVXX12AS111
3KJH_12KJH_12ZXC123ASD3456RT45KJH_121921232528313437
449111315171921232528313437
53434ASSSYU87YUIIISD7AS/SSSZXCDSDDEFGG3437
62525NBXZAQ123445RTT1921232528313437
779111315171921232528313437
8911131517VB21VBNNNN*SDD31ASD37
1
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try with this formula:

Libro1
ABCDEFGHIJK
1
2000000000
3KJH_12KJH_12XD
4000
5
6
7
8
9KJH_12
Hoja1
Cell Formulas
RangeFormula
B2:B3B2=IF(SUMPRODUCT((E2:Q9=A2)*(1)),A2,"")
 
Upvote 0
nice formula thanks dante if is possible by vba actually this a simple sample but my data at least 1000 rows as you know if i pull this formula it takes more time
thanks again
 
Upvote 0
Try this:

VBA Code:
Sub Search_Symbol()
  Dim a As Variant, b As Variant, c As Variant
  Dim i As Long, j As Long, k As Long, lr As Long, lc As Long
  
  a = Range("A2", Range("A" & Rows.Count).End(3)).Value2
  ReDim c(1 To UBound(a, 1), 1 To 1)
  lr = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.Rows.Count).Row
  lc = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column
  b = Range(Cells(2, 5), Cells(lr, lc)).Value2
  
  For i = 1 To UBound(a, 1)
    For j = 1 To UBound(b, 1)
      For k = 1 To UBound(b, 2)
        If LCase(b(j, k)) = LCase(a(i, 1)) Then
          c(i, 1) = "'" & a(i, 1)
        End If
      Next
    Next
  Next
  
  Range("B2").Resize(UBound(c, 1)).Value = c
End Sub
 
Upvote 0
great code ! dante if is possible i would amending the code when write in a2 the value with only match next row as your picture in post #2 if 000 not existed c2:k2 then should empty in b2 and ignored with rests of rows and so on the rests data b3,b4...etc
thanks again
 
Upvote 0
Try this:
VBA Code:
Sub Macro1()
  Application.ScreenUpdating = False
  With Range("B2:B" & Range("A" & Rows.Count).End(3).Row)
    .FormulaR1C1 = "=IFERROR(HLOOKUP(RC[-1],RC[1]:RC[9],1,0),"""")"
    .Copy
    .PasteSpecial xlPasteValues
  End With
  Application.CutCopyMode = False
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
astonishing work thanks for your formula and codes they're work excellently
best regards
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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