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: 4
Default Selection a row while within a "FOR Each"

Hi all,

I try to avoid cluttering this group with messages - waiting
until I've tried everything I can and have exhausted every-
thing I can think of. Well, I'm there now. So, right to the
point to avoid any excess bandwidth.

I have a spreadsheet containing columns of data. Row one has
column titles. Column "E" contains a "Date" (custom) formatted
as "ddd | yy/mm/dd" [not that it matters as far as this question
is concerned]. The number of rows may vary from 50 to 2000 but
the (row) last cell in column A will contain "EOList."

So far I have developed multiple routines with:

FOR Each Cell_In_Loop In Range("CELL2:CELL2000")
IF ( Cell_In_Loop.Offset(0, Whatever to get Cell A).Value _
= "EOList" ) Then
' Whatever
Exit For
Else
' Whatever
End If
Next

This has worked fine until now... . What I need to do now is
insert a blank line each time the day changes. I haven't had
any problem changing the color of the cell's text or it's
interior color. I've been able to pick out the day of the
week easily using the weekday function on the date which is
stored in the cell.

The problem arises when I try to "select" the row (when the
day changes) and insert a blank row before that row. Excel
says an object has to be selected/declared. Here's what
I've tried. (I started small just trying to put in a blank row
before the "EOList" row.)

FOR Each Cell_In_Loop In Range("CELL2:CELL2000")
IF ( Cell_In_Loop.Offset(0, Whatever to get Cell A).Value _
= "EOList" ) Then
Rows(Cell_In_Loop.Offset(0, 0)).Select
Selection.Insert Shift:=xlDown
Exit For
Else
' Whatever
End If
Next

Suggestions/Solutions?

David


 
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
"Center across selection" rather than "Merge cells" Elardus Excel Discussion (Misc queries) 10 November 6th 08 02:28 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Icon for "Wrap" and for "Centre Across Selection" BeSmart Excel Worksheet Functions 2 November 16th 05 06:44 PM


All times are GMT +1. The time now is 05:28 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"