View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Right & Split question

Hi Stuart
what is your actual question :-)
Do not see an error in your code. Though I would change
If Right(C, 2) = "m2" Then
x = Split(C, " ")

to
If Right(C.value, 2) = "m2" Then
x = Split(C.value, " ")


--
Regards
Frank Kabel
Frankfurt, Germany

Stuart wrote:
I sample cells in col E, for data that ends as "m2":
Because I do not know this data. I look for the
last 2 characters:

Dim C As Range, x As Variant

With ActiveSheet
For Each C In Intersect(Range("E:E"), ActiveSheet.UsedRange)
If Right(C, 2) = "m2" Then
x = Split(C, " ")
'do my stuff
End If
Next
End With

Help please.

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.596 / Virus Database: 379 - Release Date: 26/02/2004