View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Adnan Adnan is offline
external usenet poster
 
Posts: 59
Default How to convert cell formula functions to code functions

Hi,

Does anyone know how to convert the two following formula lines to code:

=TRIM(MID(B29,FIND("NCE:",B29,1)+5,FIND("TO",B29,1 )-FIND("NCE:",B29,1)-5))
=TRIM(RIGHT(A7,LEN(A7)-FIND("TO",A7,1)-1))

I tryied it myslef but can't get it to work, I'm getting a compiling error,
here's what I have so far:

Format(Trim(Mid(InStr(1, Cells(4, 2) + 5, "NCE:", 1), InStr(1, Cells(4, 2),
"TO") - InStr(1, Cells(4, 2) - 5))), "dd-mmm-yy")
Format(Trim(Right(Cells(4, 2), Len(Cells(4, 2)) - InStr(1, "TO", Cells(4,
2), 1) - 1)), "dd-yyy-mm")

Thanks for any help provided,
Adnan