DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address <> "$F$1" Then Exit Sub
[e7:f1000] = ""
Cells.Font.ColorIndex = xlAutomatic
[f3].Value = [f1].Value
Application.EnableEvents = False
For s = 2 To Cells(Rows.Count, 1).End(3).Row
Set c = [f1].Find(Trim(Cells(s, 1).Value), Lookat:=xlPart)
If Not c Is Nothing Then
x = x + 1
Cells(6 + x, 5) = Cells(s, 1).Value
Cells(6 + x, 5).Font.ColorIndex = 3
Cells(6 + x, 6) = Cells(s, 2).Value
[f3].Characters(Start:=InStr(UCase([f1]), UCase(Trim(Cells(s, 1).Value))), Length:=Len(Trim(Cells(s, 1).Value))).Font.ColorIndex = 3
End If
Next
Application.EnableEvents = True
End Sub
For s = 3 To Cells(Rows.Count, "B").End(3).Row
Set c = Columns("h:p").[COLOR="Red"]Find(" " & Trim[/COLOR](Cells(s, 2).Value), LookAt:=xlPart)
If Not c Is Nothing Then
For s = 3 To Cells(Rows.Count, "B").End(3).Row
Set c = Columns("h:p").Find(" " & Trim(Cells(s, 2).Value), LookAt:=xlPart)
If Not c Is Nothing Then
Set c = Columns("h:p").Find(" " & Trim(Cells(s, 2).Value), LookAt:=xlPart)
Bir sonraki sorum bu olacaktıÇok çok teşekkür ederim.
Aşağıdaki kod satırında " " kısmını "" olarak değiştirirsem ilk kelimeyi buluyor ama bu sefer de uç-havuç durumu yine ortaya çıkıyor.
Kod:Set c = Columns("h:p").Find(" " & Trim(Cells(s, 2).Value), LookAt:=xlPart)
Bu durumda ne yapmamız lazım ?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address <> "$H$2" Then Exit Sub
[e3:f1000] = ""
Cells.Font.ColorIndex = xlAutomatic
Application.EnableEvents = False
[H2].Value = Trim([H2].Value)
[H12].Value = " " & [H2].Value
[H2].Value = [H12].Value
For s = 3 To Cells(Rows.Count, "B").End(3).Row
Set c = Columns("h:p").Find(" " & Trim(Cells(s, 2).Value), LookAt:=xlPart)
If Not c Is Nothing Then
x = x + 1
Cells(2 + x, "E") = Cells(s, "B").Value
Cells(2 + x, "E").Font.ColorIndex = 3
Cells(2 + x, "F") = Cells(s, "C").Value
[H12].Characters(Start:=InStr(UCase([H2]), UCase(Trim(Cells(s, "B").Value))), Length:=Len(Trim(Cells(s, "B").Value))).Font.ColorIndex = 3
End If
Next
Set c = Nothing
Application.EnableEvents = True
End Sub
MerhabaTeşekkür ederim. O problem de halloldu.
Ancak bu sefer daha farklı bir problem var.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address <> "$H$2" Then Exit Sub
[e3:f10000] = ""
[h12] = [h2]
[h12].Font.ColorIndex = xlAutomatic
Application.EnableEvents = False
For a = 1 To Len(Trim([h2].Value))
If Mid([h2].Value, a, 1) = " " Then
b = Empty: x = 0
Else
b = b & Mid([h2].Value, a, 1)
If x = 0 Then x = a
If Len(b) >= 2 Then
Set c = Range("b2:b" & Cells(Rows.Count, "b").End(3).Row).Find(b, after:=[b2], lookat:=xlWhole)
If Not c Is Nothing Then
[h12].Characters(x, Len(b)).Font.ColorIndex = 3
j = Cells(Rows.Count, "e").End(3).Row + 1
m = WorksheetFunction.CountIf(Range("e3:e" & j), b)
m2 = WorksheetFunction.CountIf(Range("b3:b" & Cells(Rows.Count, "b").End(3).Row), b)
If m < m2 Then
Range("e" & j & ":f" & j).Value = Range("b" & c.Row & ":c" & c.Row).Value
Range("e" & j).Font.ColorIndex = 3
If m2 > 1 Then
u = c.Row
For a2 = 1 To m2 - 1
Set c2 = Range("b" & u & ":b" & Cells(Rows.Count, "b").End(3).Row).Find(b, after:=Range("b" & u), lookat:=xlWhole)
If Not c2 Is Nothing Then
j = Cells(Rows.Count, "e").End(3).Row + 1
Range("e" & j & ":f" & j).Value = Range("b" & c2.Row & ":c2" & c.Row).Value
Range("e" & j).Font.ColorIndex = 3
u = c2.Row
End If:
Next
End If
End If
End If:
End If
End If
Set c = Nothing
Next
Application.EnableEvents = True
End Sub