Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Quick Question re For and Next

Am trying to search through all of the Column E, and if any cell = "SUPPORT"
AND the offset (0,4) to that cell < "", then it should put the word "Note 1"
in the cell's offset (0,5). I keep getting the error message 'Next Without a
For', but I have a 'for' in the code (see below). Can someone please advise
what I'm doing wrong?


With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count, "E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
Next rng

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Quick Question re For and Next

Paige,

You need and EndIf to match your If. Sometimes the messages get a little
mixed up as to which pair of With/End With, For/Next, End/EndIf is missing a
piece.

hth,

Doug

"Paige" wrote in message
...
Am trying to search through all of the Column E, and if any cell =
"SUPPORT"
AND the offset (0,4) to that cell < "", then it should put the word "Note
1"
in the cell's offset (0,5). I keep getting the error message 'Next
Without a
For', but I have a 'for' in the code (see below). Can someone please
advise
what I'm doing wrong?


With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count,
"E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
Next rng



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Quick Question re For and Next

With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count,
"E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
end if
Next rng

Regards,
--
AP

"Paige" a écrit dans le message de
...
Am trying to search through all of the Column E, and if any cell =

"SUPPORT"
AND the offset (0,4) to that cell < "", then it should put the word "Note

1"
in the cell's offset (0,5). I keep getting the error message 'Next

Without a
For', but I have a 'for' in the code (see below). Can someone please

advise
what I'm doing wrong?


With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count,

"E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
Next rng



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Quick Question re For and Next

With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count, "E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
end if
Next rng

--
Regards,
Tom Ogilvy

"Paige" wrote:

Am trying to search through all of the Column E, and if any cell = "SUPPORT"
AND the offset (0,4) to that cell < "", then it should put the word "Note 1"
in the cell's offset (0,5). I keep getting the error message 'Next Without a
For', but I have a 'for' in the code (see below). Can someone please advise
what I'm doing wrong?


With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count, "E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
Next rng

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Quick Question re For and Next

Darn Darn Darn! I messed around with this for 2 hours. Sometimes I can't
see the forest for the trees. Thanks guys!!!

"Tom Ogilvy" wrote:

With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count, "E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
end if
Next rng

--
Regards,
Tom Ogilvy

"Paige" wrote:

Am trying to search through all of the Column E, and if any cell = "SUPPORT"
AND the offset (0,4) to that cell < "", then it should put the word "Note 1"
in the cell's offset (0,5). I keep getting the error message 'Next Without a
For', but I have a 'for' in the code (see below). Can someone please advise
what I'm doing wrong?


With wks
Set rngToSearch = .Range(.Range("E12"), .Cells(Rows.Count, "E").End(xlUp))
End With
For Each rng In rngToSearch
If rng.Value = "SUPPORT" And rng.Offset(0, 4) < "" Then
rng.Offset(0, 5).Value = "Note 1"
Next rng

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
Quick Question Kory Excel Discussion (Misc queries) 1 July 21st 07 09:46 AM
Quick Question Jenn Excel Discussion (Misc queries) 2 November 1st 05 09:20 PM
Quick question - quick answer about assigning shortcut keys funkymonkUK[_75_] Excel Programming 1 October 13th 05 10:50 AM
Very Quick Question Chuckles123[_69_] Excel Programming 1 November 18th 04 05:49 PM
Quick Question Jayhawktc[_2_] Excel Programming 1 April 14th 04 02:09 PM


All times are GMT +1. The time now is 05:36 AM.

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

About Us

"It's about Microsoft Excel"