Stephen_IV
Well-known Member
- Joined
- Mar 17, 2003
- Messages
- 1,174
- Office Version
- 365
- 2019
- Platform
- Windows
Good evening,
I am trying to find a VBA Function that will get everything after the 4th space. I know how to do this with a formula but I am learning VBA. I found something on the internet that finds the position but I am not good enough to modify it. Any help would be appreciated!
I found this code that finds the position on the 4th space.
I am trying to find a VBA Function that will get everything after the 4th space. I know how to do this with a formula but I am learning VBA. I found something on the internet that finds the position but I am not good enough to modify it. Any help would be appreciated!
|
I found this code that finds the position on the 4th space.
VBA Code:
Function FindN(s As String, sFindWhat As String, N As Integer) As Integer
Dim J As Integer
Application.Volatile
FindN = 0
For J = 1 To N
FindN = InStr(FindN + 1, s, sFindWhat)
If FindN = 0 Then Exit For
Next
End Function