LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default For Each Loop w/ a range

The basics of my code a

For each cell in Range("A1, B3, C5")
If cell.value=x Then
'change to this value
Else
'change to another value
End If
Next Cell

But this only seems to work on the first cell. What I am trying to do is
iterate through small group of cells (not necessarily in an array) to see
whether the date in each is a good business day. If not, the code replaces
the date with a string variable. Can you not use a For Each Loop for this?
 
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
loop in range Aksel Børve Excel Programming 3 March 9th 05 02:30 PM
Loop in a Range aksel børve Excel Programming 2 March 8th 05 06:40 PM
Loop through Range and Cut and Paste Kevin L Excel Programming 2 February 16th 05 06:19 PM
Loop through a range Fred[_21_] Excel Programming 6 October 22nd 04 10:45 PM
Increasing a range in a loop ric Excel Programming 4 April 26th 04 07:59 PM


All times are GMT +1. The time now is 06:21 AM.

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"