Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Question on determining "ROW" inside of a "For .. RANGE " loop

I think you will find (pun intended) what you want by look in vba help for
FINDNEXT. There is a good example. You find the row and subtract from row 1.

--
Don Guillett
SalesAid Software

"David Schrader" wrote in message
...
I'll be the first to admit that I'm not the most sophisticated of
Excel macro writers. I've written some macros, some better
than others and some demanding some fairly advanced skill.
But I've run up against something that's got me running in
a loop trying to find an answer which I haven't been able
to, as yet, find. Thus my appeal here.

I have a sheet which may be any length from 50 to1900
some entries. I have a routine which will find the last
"employ" row and place an "flag" in $A$1 so that all of my
future routines can test for it (see the example below).
I want to create three RANGEs, by name, and need to
be able to identify the number of ROWs between $A$2
and the cell $A$n which holds the flag (EOList) -1. So
far all of my efforts to code such a beast have failed.

Any suggestions? (Here's my general structure.)

David


For Each Cell_in_loop In Range("A2:A2000")
If Cell_in_loop.Offset(0, 0).Value = "EOList" Then
Exit For
Else
' Error msg = "Object required...'
' Looper = System.Row(Cell_in_loop.Offset(0, 0))
End If
Next
' With the cell value stored in *Looper* we can now
' create the ranger
' ThisWorkbook.Names.Add Name:="SortName1", _
' RefersTo:=("=$B$2$B$" & CStr(Looper) _
' & Chr(34)), Visible:=True




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Question on determining "ROW" inside of a "For .. RANGE " loop

I'll be the first to admit that I'm not the most sophisticated of
Excel macro writers. I've written some macros, some better
than others and some demanding some fairly advanced skill.
But I've run up against something that's got me running in
a loop trying to find an answer which I haven't been able
to, as yet, find. Thus my appeal here.

I have a sheet which may be any length from 50 to1900
some entries. I have a routine which will find the last
"employ" row and place an "flag" in $A$1 so that all of my
future routines can test for it (see the example below).
I want to create three RANGEs, by name, and need to
be able to identify the number of ROWs between $A$2
and the cell $A$n which holds the flag (EOList) -1. So
far all of my efforts to code such a beast have failed.

Any suggestions? (Here's my general structure.)

David


For Each Cell_in_loop In Range("A2:A2000")
If Cell_in_loop.Offset(0, 0).Value = "EOList" Then
Exit For
Else
' Error msg = "Object required...'
' Looper = System.Row(Cell_in_loop.Offset(0, 0))
End If
Next
' With the cell value stored in *Looper* we can now
' create the ranger
' ThisWorkbook.Names.Add Name:="SortName1", _
' RefersTo:=("=$B$2$B$" & CStr(Looper) _
' & Chr(34)), Visible:=True


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Question on determining "ROW" inside of a "For .. RANGE " loop

Thank you Don. I'll go look there immediately.

David

(And I love puns.)

"Don Guillett" wrote in message
...
I think you will find (pun intended) what you want by look in vba help for
FINDNEXT. There is a good example. You find the row and subtract from row
1.

--
Don Guillett
SalesAid Software

"David Schrader" wrote in message
...
I'll be the first to admit that I'm not the most sophisticated of
Excel macro writers. I've written some macros, some better
than others and some demanding some fairly advanced skill.
But I've run up against something that's got me running in
a loop trying to find an answer which I haven't been able
to, as yet, find. Thus my appeal here.

I have a sheet which may be any length from 50 to1900
some entries. I have a routine which will find the last
"employ" row and place an "flag" in $A$1 so that all of my
future routines can test for it (see the example below).
I want to create three RANGEs, by name, and need to
be able to identify the number of ROWs between $A$2
and the cell $A$n which holds the flag (EOList) -1. So
far all of my efforts to code such a beast have failed.

Any suggestions? (Here's my general structure.)

David


For Each Cell_in_loop In Range("A2:A2000")
If Cell_in_loop.Offset(0, 0).Value = "EOList" Then
Exit For
Else
' Error msg = "Object required...'
' Looper = System.Row(Cell_in_loop.Offset(0, 0))
End If
Next
' With the cell value stored in *Looper* we can now
' create the ranger
' ThisWorkbook.Names.Add Name:="SortName1", _
' RefersTo:=("=$B$2$B$" & CStr(Looper) _
' & Chr(34)), Visible:=True






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
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
Validation question - allow -500%, 0%, "=50%*50%" but forbid "A", "", " ", "-" ? tskogstrom Excel Programming 2 November 27th 06 09:50 AM
Listbox header inside VBA (Array("Head1", "Head2", ...) Alex St-Pierre Excel Programming 2 October 25th 06 09:28 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM


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