View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Instr function problem

Ross,

Use the InStrRev function. E.g.,

Debug.Print InStrRev(Range("A1"), "a", -1, vbTextCompare)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ross Withey" wrote in message
...
Hello,
If cell A1 has the string value "Bananas"

Instr(1,"Range("A1"), "a") finds the first "a". My problem is, I want to
find the final "a".
Can you suggest the right code? I know I can increase the "1", but I need

to
find the final "a" at the first attempt in a loop. Can you help please?
Thanks,
Ross