Message 1 of 5
ilogic VBA InStrRev not reversing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i want it to find the project folder and the project name, so i tell it to find the constant value (427, our office number)
but for some strange reason InStr and InStrRev both return the same number rather than reversing the search direction. what's wrong with my code?
'dims oPath = ThisDoc.Path 'get base project folder placement oGet01 = InStr(oPath, "427")-1 oSet01 = Left(oPath, oGet01) 'get project name oGet02 = InStrRev(oPath, "427")-1 oSet02 = Right(oPath, oGet02) oGet03 = InStr(oSet02, "\") oSet03 = Left(oSet02, oGet03) MessageBox.Show("Get1: " & oGet01 & vbCrLf & "Set1: " & oSet01 & vbCrLf & "Get2: " & oGet02 & vbCrLf & "Set2: " & oSet02 & vbCrLf & "Get3: " & oGet03 & vbCrLf & "Set3: " & oSet03)