ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please help with this error (https://www.excelbanter.com/excel-programming/360920-please-help-error.html)

alvin Kuiper

Please help with this error
 
Hi i use this:
side =Mid(folder, (InStrRev(folder, "_") + 1))

But not all folder has a underscore
I only want to see the folder whit underscore

I understand i shall use a If but how???
Regards
alvin


Ivan Raiminius

Please help with this error
 
Hi Alvin,

on error resume next
side =Mid(folder, (InStrRev(folder, "_") + 1))
if err< then
err = 0
' underscore not found
else
'underscore found
end if
on error goto 0

Regards,
Ivan


Norman Jones

Please help with this error
 
Hi Alvin,

Try:

If InStr(folder, "_") Then
side = Mid(folder, (InStrRev(folder, "_") + 1))
End If


---
Regards,
Norman


"alvin Kuiper" wrote in message
...
Hi i use this:
side =Mid(folder, (InStrRev(folder, "_") + 1))

But not all folder has a underscore
I only want to see the folder whit underscore

I understand i shall use a If but how???
Regards
alvin




alvin Kuiper

Please help with this error
 
Thanks
its working

Alvin


"Norman Jones" wrote:

Hi Alvin,

Try:

If InStr(folder, "_") Then
side = Mid(folder, (InStrRev(folder, "_") + 1))
End If


---
Regards,
Norman


"alvin Kuiper" wrote in message
...
Hi i use this:
side =Mid(folder, (InStrRev(folder, "_") + 1))

But not all folder has a underscore
I only want to see the folder whit underscore

I understand i shall use a If but how???
Regards
alvin






All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com