Masta
New Member
- Joined
- Feb 22, 2022
- Messages
- 33
- Office Version
- 2021
- 2019
- 2016
- Platform
- Windows
Private Sub CommandButton207_Click()
TextBox57.Paste
Application.Wait (Now + TimeValue("0:00:01"))
Dim ws As Variant
Dim iSplit As Integer
Dim kucniBroj As String
Dim kb As Variant
Set ws = Worksheets("Prevod")
'Application.Wait (Now + TimeValue("0:00:01"))
ws = Split(ws.Range("K75").Text, ",")
TextBox58 = ws(0) & "-" & ws(1)
iSplit = InStrRev(ws(2), " ")
TextBox59 = Trim(Left(ws(2), iSplit - 1))
kucniBroj = Trim(Mid(Trim(ws(2)), iSplit - 1))
'kb = Split(kucniBroj, "/")
iSplit = InStr(kucniBroj, "/")
TextBox4 = Trim(Left(kucniBroj, iSplit - 1))
TextBox5 = Trim(Mid(kucniBroj, iSplit + 1))
TextBox58.SelStart = 0
TextBox58.SelLength = TextBox58.TextLength
TextBox58.Cut
TextBox2.SetFocus
TextBox2.SelStart = 0
TextBox2.Paste
TextBox58.SelStart = 0
TextBox59.SelStart = 0
TextBox59.SelLength = TextBox59.TextLength
TextBox59.Cut
TextBox3.SetFocus
TextBox3.SelStart = 0
TextBox3.Paste
TextBox59.SelStart = 0
CommandButton207.Enabled = False
End Sub
This is part of my coding for sorting street adresses and so far i have sucess with this part then i stuck on one problem.
This is original data that this part of code splitting and this woork good with this code:
BEOGRAD, STARI GRAD, CARA DUŠANA 021/33/28
But then i have other itteration like this
BEOGRAD, STARI GRAD, CARA DUŠANA 180
I got error , run-time error '5' Invalid procedure call or argument.
I think its problem with slash (/), i was try to do IF statement but with no luck.
Please i need help. Im not expirienced with excel vba on pro level.
TextBox57.Paste
Application.Wait (Now + TimeValue("0:00:01"))
Dim ws As Variant
Dim iSplit As Integer
Dim kucniBroj As String
Dim kb As Variant
Set ws = Worksheets("Prevod")
'Application.Wait (Now + TimeValue("0:00:01"))
ws = Split(ws.Range("K75").Text, ",")
TextBox58 = ws(0) & "-" & ws(1)
iSplit = InStrRev(ws(2), " ")
TextBox59 = Trim(Left(ws(2), iSplit - 1))
kucniBroj = Trim(Mid(Trim(ws(2)), iSplit - 1))
'kb = Split(kucniBroj, "/")
iSplit = InStr(kucniBroj, "/")
TextBox4 = Trim(Left(kucniBroj, iSplit - 1))
TextBox5 = Trim(Mid(kucniBroj, iSplit + 1))
TextBox58.SelStart = 0
TextBox58.SelLength = TextBox58.TextLength
TextBox58.Cut
TextBox2.SetFocus
TextBox2.SelStart = 0
TextBox2.Paste
TextBox58.SelStart = 0
TextBox59.SelStart = 0
TextBox59.SelLength = TextBox59.TextLength
TextBox59.Cut
TextBox3.SetFocus
TextBox3.SelStart = 0
TextBox3.Paste
TextBox59.SelStart = 0
CommandButton207.Enabled = False
End Sub
This is part of my coding for sorting street adresses and so far i have sucess with this part then i stuck on one problem.
This is original data that this part of code splitting and this woork good with this code:
BEOGRAD, STARI GRAD, CARA DUŠANA 021/33/28
But then i have other itteration like this
BEOGRAD, STARI GRAD, CARA DUŠANA 180
I got error , run-time error '5' Invalid procedure call or argument.
I think its problem with slash (/), i was try to do IF statement but with no luck.
Please i need help. Im not expirienced with excel vba on pro level.