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?
...As Range) As Integer
Dim reg As Object, uzunluk As Integer, fark As Integer
uzunluk = Len(hcr.Value)
Set reg = CreateObject("vbscript.regexp")
reg.Global = True
reg.Pattern = "^\s+"
fark = uzunluk - Len(reg.Replace(hcr, ""))
BOSLUKLAR = fark
End Function
Dilediğiniz hücreye...
Sub test()
Dim huc As Range
With CreateObject("VBScript.RegExp")
.Pattern = "(\d+)\.(\d+\.\d+)"
For Each huc In Selection
If .test(huc) Then huc.Value = .Replace(huc, "$1$2")
Next
End With
End Sub
Aşağıdaki fonksiyonları deneyiniz.
Function getAmount(str As String)
With CreateObject("VBscript.RegExp")
.Global = True
.Pattern = "TL\s\d+(\,\d+)?"
str = Replace(WorksheetFunction.Trim(str), ".", "")
If .Test(str) Then
getAmount =...
RegExp kullanarak VBA ile alternatif;
Function getAmount(str As String)
With CreateObject("VBscript.RegExp")
.Global = True
.Pattern = "TL\s\d+(\,\d+)?"
str = Replace(WorksheetFunction.Trim(str), ".", "")
If .Test(str) Then
getAmount =...
...yazdırabilirsiniz....
Sub GetAltin()
' Haluk - 14/05/2020
'
Dim objHTTP As Object, strURL As String, HTMLcode As String
Dim regExp As Object, valDoviz As Variant
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
strURL =...
Sub test()
With CreateObject("VBScript.Regexp")
.Global = True
.Pattern = "a"
With .Execute(Range("A1").Value)
If .Count > 2 Then
MsgBox .Item(2).firstindex + 1
Else
MsgBox "3 adet a yoktur."
End If...
Hocam, Tam benim istediğim gibi kodlamayı yapmışsınız. Teşekkür ederim.
Ancak benim hesaplayamadığım bir nokta olduğundan bu durumu kendim çözmeye çalışıyorum.
yapamazsam tekrar konuyu anlatırım. Tekrar teşekkürler
Öncelikle cevabınız için çok teşekkür ederim. Elimde olmayan nedenler ile geç geri dönüş yaptığımın farkındayım. Bunun için affınıza sığınıyorum. Kodları denemeden bu cevap yazma ihtiyacını hissettim. Bu gece de test edeceğim. Tekrardan teşekkürlerimi iletirim.
Sub test()
Dim mtch As Object, sut As Integer, i As Long, bol, ii As Byte
With CreateObject("VBScript.Regexp")
.Global = True
.Pattern = "([a-zA-ZğüÜıİşŞçÇöÖ\s\.]+)(\s)([A-Z]+)([\s\d\.,%-\?ad]+)"
For i = 2 To Cells(Rows.Count, 2).End(3).Row
If...
..."GET", url, False
xmlHttp.send
responseText = xmlHttp.responseText
Dim regex As Object
Set regex = CreateObject("VBScript.RegExp")
regex.Pattern = "<distance>(.*?)<\/distance>"
Set matches = regex.Execute(responseText)
If matches.Count > 0 Then
distance...
Sub alternatif()
Dim mtch As Object, sat&
sat = 1
With CreateObject("VBScript.Regexp")
.Global = True
.Pattern = "\""Z\"":\""([\d:]+)"
If .test(Range("A1").Value) Then
Set mtch = .Execute(Range("A1").Value)
For Each mtch In...
...Bunun için makroya ne eklemeliyim?
Sub Saat()
Dim i, ii, a, bl, s1, s2, bas, son
Dim n, y As Variant
With CreateObject("VbScript.Regexp")
.Pattern = "([\d:\s]+)-([\d:\s]+)"
For i = 8 To Cells(Rows.Count, "D").End(3).Row
If .test(Cells(i, "D").Value) Then...
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.