View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default How to code macro with if condition?

Does anyone have any suggestions on how to code macro with if condition?

My code:
myCell.Offset(0,3).Value = Sheets("Temp").Range("B15").Value

If Sheets("Temp").Range("B15").Value contains "B" character, then delete "B"
and time 1000 with this number, such as 254.63B will become 254630 and assign
into myCell.Offset(0,3).Value
else
If Sheets("Temp").Range("B15").Value contains "M" character, then delete
"M", such as 117.46M will become 117.46 and assign into
myCell.Offset(0,3).Value

Does anyone have any suggestions?
Thank you very much for any suggestions
Eric