Aşağıdaki kod, isteğinizi karşılar...
Sub Test()
' Haluk - 22/03/2024
' sa4truss@gmail.com
Dim regExp As Object, myRange As Range
Set regExp = CreateObject("VBscript.RegExp")
regExp.Pattern = "\(\d+\)"
regExp.Global = True
For Each Match In...
...If WorksheetFunction.CountA(rng) = 0 Then Exit Sub
Set rng = rng.SpecialCells(xlCellTypeConstants)
With CreateObject("VBScript.RegExp")
.Pattern = "\d"
.Global = True
.IgnoreCase = True
For Each r In rng
If .test(r.Value) Then r.Offset(...
...As String) As String
Dim result As String, objRegEx As Object, match As Object
Set objRegEx = CreateObject("vbscript.regexp")
objRegEx.Pattern = "[a-zA-Z]+"
objRegEx.Global = True
objRegEx.IgnoreCase = True
If objRegEx.test(str) Then
Set match =...
Sözkonusu ifade eğer A1 hücresindeyse, aşağıdaki "REGEXP" kodu işinizi görecektir;
Sub Test()
'Haluk - 20/01/2024
Dim objRegEx As Object, RetVal As Object, temp As String, myStr As String
Set objRegEx = CreateObject("VBscript.RegExp")
objRegEx.Global = True...
Bir de bunu deneyiniz.
Sub tcnoyual()
Set nesne = CreateObject("VBScript.Regexp")
nesne.Global = True
nesne.Pattern = "\D(\d{11})\D"
For a = 2 To [I65536].End(3).Row
Set veri = nesne.Execute(Cells(a, "I"))
If veri.Count > 0 Then Cells(a, "j") = Mid(nesne.Execute(Cells(a, "I")).Item(0), 2, 11)...
Sayın hocam t.c. kimlik numaralarının başında karakter olduğu zaman almıyor boşluk varsa alıyor da t.c.:111, -111...- şeklimde olanları almıyor bir çözümü var mıdır
Sub test()
Range("B:Z").ClearContents
Dim huc As Range, m As Object, sut
With CreateObject("VBScript.RegExp")
.Pattern = "[\d]+|[^\d]+"
.Global = True
For Each huc In Range("A1:A" & Cells(Rows.Count, 1).End(3).Row)
If .test(huc.Value) Then...
...Function VirguldenAl(metin As String, sira As Integer) As String
Dim parcalar() As String
Set r = CreateObject("VBScript.RegExp")
sPattern = "\d+"
r.Pattern = sPattern
parcalar = Split(metin, ",")
If sira >= 1 And sira <= UBound(parcalar) + 2 Then...
...If Len(Me.TextBox1) = 2 And Right(Me.TextBox1, 1) = ":" Then Me.TextBox1 = "0" & Me.TextBox1: Exit Sub
Set nesne = CreateObject("VBScript.Regexp")
Select Case Len(TextBox1)
Case 1: nesne.Pattern = "^[0-9]"
Case 2: nesne.Pattern = "^(0[0-9]|1[0-9]|2[0-3])$"
Case...
...İsterseniz kodda döngüde kullanın.
Function Temizle(alan As Range)
Dim regEx As Object
Dim str As String
Set regEx = CreateObject("VBScript.RegExp")
With regEx
.Global = True
.IgnoreCase = True
.Pattern = "^\W{1,999}|\W{1,999}$"
End With
Temizle = regEx.Replace(alan.Value...
Fonksiyonu kullanabilirsiniz.
Function RemoveWhiteSpace(target As String) As String
With CreateObject("VBScript.RegExp")
.Pattern = "\s"
.MultiLine = True
.Global = True
RemoveWhiteSpace = .Replace(target, vbNullString)
End With
End Function
RegExp ile alternatif;
Function AddSpace(myRange As Range) As String
' Haluk - 16/11/2023
Dim regExp As Object
Set regExp = CreateObject("VBScript.RegExp")
regExp.IgnoreCase = True
regExp.Global = True
regExp.Pattern = "(.)"
AddSpace =...
Tekrar merhaba, şu da benim işimi çözebilir; parça numarasının başındaki boşluklar hariç numara içerisindeki boşlukları silen bir formül de olabilir.
Mesela; ( ka 07x17x22 pr) burda ka'dan önceki boşluklara dokunmadan 07 ve pr'den önceki boşluğu silebilir miyiz?
Sizlere daha iyi bir deneyim sunabilmek icin sitemizde çerez konumlandırmaktayız, web sitemizi kullanmaya devam ettiğinizde çerezler ile toplanan kişisel verileriniz Veri Politikamız / Bilgilendirmelerimizde belirtilen amaçlar ve yöntemlerle mevzuatına uygun olarak kullanılacaktır.