View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Turn formula into Select

Rick,

Yes your suggestion is more intuitive then my ASCII test, thanks for that. I
perhaps should also have included

If Len(Range("M4").Value) < 2 Then End

to test for 1 character in the cell which in my code would have evaluated as
blank when the cell wasn't empty.

Mike

"Rick Rothstein (MVP - VB)" wrote:

See inline...

Do you mean the VB select case? if you do try this:-

Sub sonic()
mystring = Mid(Range("M4"), 2, 1)
Select Case mystring
Case Chr(48) To Chr(57)


This might be more readable than the above...

Case "0" To "9"

Rick



myvalue = "Manual"
Case Is < ""
myvalue = "Auto"
Case Else
myvalue = ""
End Select
End Sub

"Hile" wrote:

Can someone turn the following formula into a select statement:
IF(ISBLANK(M4),"",IF(ISNUMBER(--MID(M4,2,1)),"Manual","Auto"))

Basically I'm tagging a record based on a value, if the second character
in
the string contained in the specific column (field) is a number I want
this
column to say "Manual" esle Auto and leave blank if no value.

I'm migrating this report into BI and I can't figure out how to do this
in
their interface, but I can write select statement for it. It will be a
calculation based on the field containing the data.

Thanks
--
Hile