JOSEJUNIOR0021
New Member
- Joined
- Apr 24, 2016
- Messages
- 2
Hello guys,
I have a little problem that I could find solution anywhere. and I bet it must be a simple one.
I've created a few functions to deal with IPs.
For example, I have in one cell the IP 172.21.103.166 and I want to add or subtract on the last octet (.166)
what is been happening is, if I have the workbook with that function opened, and I create a subroutine in any other workbook, as I run my subroutine step by step with F8 to test what I'm doing, it "jumps" to that function by itself.
At some point on my subroutine, it jumps to the function, loops the function a few times, and returns to my subroutine.
No errors or any other kind of messages appear. And, as it happens so fast, if I just run my subroutine I's not noticeable. But when I'm checking it step by step it gets very annoying.
I do not use the function on the subroutine.
Bellow is the function in question and an example of a subroutine that faces this problem.
By the way, English is not my first language, so forgive me for any grammar mistakes.
Here is the function:
Function MUDAIP(ipsep As String, valor As Long)
Dim separaip() As String
separaip() = Split(ipsep, ".")
separaip(3) = separaip(3) + valor
MUDAIP = separaip(0) & "." & separaip(1) & "." & separaip(2) & "." & separaip(3)
End Function
Here is an example of subroutine:
Sub DELLINHAVAZIA()
Dim SITE, TX As String
Dim LIM1, LIM, A As Long
LIM = Cells(Rows.Count, 1).End(xlUp).Row
LIM1 = 1
Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
For A = 10 To LIM
SITE = Cells(A, 1).Value
SITE = Left(SITE, 23)
SITE = Right(SITE, 14)
SITE = Trim(SITE)
TX = Left(Cells(A, 1).Value, 78)
TX = Right(TX, 5)
TX = Trim(TX)
If TX = "ATM" Then
Cells(LIM1, 10).Value = SITE
Cells(LIM1, 11).Value = TX
LIM1 = LIM1 + 1
End If
Next A
I have a little problem that I could find solution anywhere. and I bet it must be a simple one.
I've created a few functions to deal with IPs.
For example, I have in one cell the IP 172.21.103.166 and I want to add or subtract on the last octet (.166)
what is been happening is, if I have the workbook with that function opened, and I create a subroutine in any other workbook, as I run my subroutine step by step with F8 to test what I'm doing, it "jumps" to that function by itself.
At some point on my subroutine, it jumps to the function, loops the function a few times, and returns to my subroutine.
No errors or any other kind of messages appear. And, as it happens so fast, if I just run my subroutine I's not noticeable. But when I'm checking it step by step it gets very annoying.
I do not use the function on the subroutine.
Bellow is the function in question and an example of a subroutine that faces this problem.
By the way, English is not my first language, so forgive me for any grammar mistakes.
Here is the function:
Function MUDAIP(ipsep As String, valor As Long)
Dim separaip() As String
separaip() = Split(ipsep, ".")
separaip(3) = separaip(3) + valor
MUDAIP = separaip(0) & "." & separaip(1) & "." & separaip(2) & "." & separaip(3)
End Function
Here is an example of subroutine:
Sub DELLINHAVAZIA()
Dim SITE, TX As String
Dim LIM1, LIM, A As Long
LIM = Cells(Rows.Count, 1).End(xlUp).Row
LIM1 = 1
Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
For A = 10 To LIM
SITE = Cells(A, 1).Value
SITE = Left(SITE, 23)
SITE = Right(SITE, 14)
SITE = Trim(SITE)
TX = Left(Cells(A, 1).Value, 78)
TX = Right(TX, 5)
TX = Trim(TX)
If TX = "ATM" Then
Cells(LIM1, 10).Value = SITE
Cells(LIM1, 11).Value = TX
LIM1 = LIM1 + 1
End If
Next A