Thread: Macro question
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_2_] Rick Rothstein \(MVP - VB\)[_2_] is offline
external usenet poster
 
Posts: 1
Default Macro question

An alternate to using the Left function is this...

If ActiveCell.Value Like "NFFU *" Then

or, if you want to make sure the characters after the "NFFU " are, in fact,
digits only, this...

If ActiveCell.Value Like "NFFU " & String(Len(ActiveCell)-5, "#") Then

Rick



"orquidea" wrote in message
...
Hi:

I have the below loop. I want to choose all the rows that have the word
starting with "NFFU (space) and any number" e.i. NFFU 55425 and type on
the
next right cell "53". When I run the below macro the loop works columns
but
no "53" is being typed in the right cell. Could anyone help me please.
I
believe the problem is in this line: If ActiveCell.Value = "NFFU *"
Then.

Thanks,
Orquidea




Range("e1").Select

Do
If ActiveCell.Value = "NFFU *" Then
ActiveCell.Offset(0, 1) = "53"
ActiveCell.Offset(1, 0).Select

Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Offset.Value = ""