Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If a Char = Quote (") Mark 1

Status
Not open for further replies.

hext2003

Technical User
Oct 9, 2006
119
US
I am cleaning up some data in an excel file. STUCK! Please help. I know I am missing something goofey!

This column is holding a dimension. The only problem is some dimensions are reports 5' some are reported 60" and some are both 5'2".

So I have the Foot problem taken care of. I want to

If Right(TempStr, 1) = "'" Then
TempStr = Left(TempStr, Len(TempStr) - 1)
End If

Just a number to be reported is fine. We are trying to get everything into feet

Now I want to find out if the last Character in the string is a " (Inch sign) if so I need to do some math. How do I write the IF part...

NONE of these work... What am I missing
If Right(TempStr, 1) = " " " Then
If Right(TempStr, 1) = " ' " ' " Then
If Right(TempStr, 1) = " " Then
If Right(TempStr, 1) = " Then
If Right(TempStr, 1) = ' " ' Then

TIA


 
Either this:
Code:
If Right(TempStr, 1) = """" Then
or this:
Code:
If Right(TempStr, 1) = Chr(34) Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you Thank you!

I knew it was a syntax thing but just couldn't find it.

I don't write enough in VB - just enough to get the job done.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top