#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Macro question

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 = ""



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Macro question

If Left(ActiveCell.Value, 5) = "NFFU " Then
--
Gary''s Student - gsnu200767
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Macro question

Try

If Left(ActiveCell.Value, 5) = "NFFU " Then

HTH,
Bernie
MS Excel MVP


"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 = ""





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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 = ""




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Macro question

Thanks Bernie for your reply. Apparently there is other error in my posted
macro because I can't get the number 53 typed beside "NFFU*". Could you
help me with it please.

Thanks,

"Bernie Deitrick" wrote:

Try

If Left(ActiveCell.Value, 5) = "NFFU " Then

HTH,
Bernie
MS Excel MVP


"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 = ""








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Macro question

Thanks Gary for your reply. Apparently there is other error in my posted
macro because I can't get the number 53 typed beside "NFFU*". Could you
help me with it please.

Thanks,


"Gary''s Student" wrote:

If Left(ActiveCell.Value, 5) = "NFFU " Then
--
Gary''s Student - gsnu200767

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Macro question

Thanks Rick for your reply. Apparently there is other error in my posted
macro because I can't get the number 53 typed beside "NFFU*". Could you
help me with it please.

Thanks,


"Rick Rothstein (MVP - VB)" wrote:

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 = ""





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Macro question

Open an otherwise blank workbook, and run the first macro below to populate
a range with strings. Then run the second to find a value with NFFU<space,
and put the value 53 next to it.

HTH,
Bernie
MS Excel MVP

Sub MakeNFFUList()
Dim i As Integer
'Populate a range with values
Range("A1").Value = "NFF Strings"
For i = 2 To 20
Cells(i, 1).Value = "NFF" & Chr(70 + i) & " " & 100 + i
Next i
End Sub

Sub FindNFFU()
'Now, look for "NFFU "
Dim myC As Range
For Each myC In Range("A2:A20")
If Left(myC.Value, 5) = "NFFU " Then
myC.Offset(0, 1).Value = 53
End If
Next myC
End Sub

"orquidea" wrote in message
...
Thanks Bernie for your reply. Apparently there is other error in my
posted
macro because I can't get the number 53 typed beside "NFFU*". Could you
help me with it please.

Thanks,

"Bernie Deitrick" wrote:

Try

If Left(ActiveCell.Value, 5) = "NFFU " Then

HTH,
Bernie
MS Excel MVP


"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 = ""








  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Macro question

If you don't show us the code you are using, we can't see what might be
wrong with it. With that said, here is your original code, simplified
slightly, which implements what I posted...

Sub FindNFFU()
Range("E1").Select
Do
If ActiveCell.Value Like "NFFU *" Then
ActiveCell.Offset(0, 1) = "53"
End If
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Offset.Value = ""
End Sub

However, look at Bernie's last posting to you for the more preferred method
of not selecting each cell individually in order to do "stuff" with it.

Rick



"orquidea" wrote in message
...
Thanks Rick for your reply. Apparently there is other error in my posted
macro because I can't get the number 53 typed beside "NFFU*". Could you
help me with it please.

Thanks,


"Rick Rothstein (MVP - VB)" wrote:

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 = ""






  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Macro question

thanks,

"Rick Rothstein (MVP - VB)" wrote:

If you don't show us the code you are using, we can't see what might be
wrong with it. With that said, here is your original code, simplified
slightly, which implements what I posted...

Sub FindNFFU()
Range("E1").Select
Do
If ActiveCell.Value Like "NFFU *" Then
ActiveCell.Offset(0, 1) = "53"
End If
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Offset.Value = ""
End Sub

However, look at Bernie's last posting to you for the more preferred method
of not selecting each cell individually in order to do "stuff" with it.

Rick



"orquidea" wrote in message
...
Thanks Rick for your reply. Apparently there is other error in my posted
macro because I can't get the number 53 typed beside "NFFU*". Could you
help me with it please.

Thanks,


"Rick Rothstein (MVP - VB)" wrote:

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 = ""









  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Macro question


thanks,
"orquidea" wrote:

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 = ""



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Question carl Excel Worksheet Functions 0 May 10th 07 03:29 PM
Macro Question Carl Excel Worksheet Functions 0 August 28th 06 06:00 PM
Macro Question Carl Excel Worksheet Functions 1 August 25th 06 07:40 PM
Macro Question Carl Excel Worksheet Functions 1 August 24th 06 09:03 PM
Macro Question Greg New Users to Excel 4 March 24th 06 03:47 PM


All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"