Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Looking for a value in a previous row

I am trying to determine a previous row number in a chart like this --
..
..
..
xxx xxx data xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Looking for a value in a previous row

If I understand you correctly; the data row will always be filled (especially
ColA,ColB,ColC) and for the current row these columns will not be filled.

In that case; the below code should give you the previous data row. Try and
feedback

Dim lngDataRow as Long
lngDataRow = Cells(Activecell.row, "C").End(xlUp).Row

If this post helps click Yes
---------------
Jacob Skaria


"ejack" wrote:

I am trying to determine a previous row number in a chart like this --
.
.
.
xxx xxx data xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx
.
.
.
xxx xxx xxx xxx (how many rows
back to data row?)
.
.
.

I would like to know the contents of the data and other cells in that row in
the lower rows. I can't figure out what key words to search for in the
discussion groups. Your help would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Looking for a value in a previous row



"Jacob Skaria" wrote:

If I understand you correctly; the data row will always be filled (especially
ColA,ColB,ColC) and for the current row these columns will not be filled.

In that case; the below code should give you the previous data row. Try and
feedback

Dim lngDataRow as Long
lngDataRow = Cells(Activecell.row, "C").End(xlUp).Row

If this post helps click Yes
---------------
Jacob Skaria


"ejack" wrote:

I am trying to determine a previous row number in a chart like this --
.
.
.
xxx xxx data xxx xxx xxx xxx xxx xxx
..................................xxx xxx xxx xxx
.
.
.
..................................xxx xxx xxx xxx (how many rows
back to data row?)
.
.
.

I would like to know the contents of the data and other cells in that row in
the lower rows. I can't figure out what key words to search for in the
discussion groups. Your help would be greatly appreciated.


Thanks Jacob, yes, you do understand that the subsequent rows will be
indented essentially. That looks like a basic code call. It has been years
since I had to use basic in my spreadsheets. Do you think it is necessary to
use basic?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Looking for a value in a previous row

The below formula will give you the next entry upwards in the range C1:C10..
=LOOKUP(2,1/(C1:C10<""),C1:C10)

So you can apply that in row 11...

If this post helps click Yes
---------------
Jacob Skaria


"ejack" wrote:



"Jacob Skaria" wrote:

If I understand you correctly; the data row will always be filled (especially
ColA,ColB,ColC) and for the current row these columns will not be filled.

In that case; the below code should give you the previous data row. Try and
feedback

Dim lngDataRow as Long
lngDataRow = Cells(Activecell.row, "C").End(xlUp).Row

If this post helps click Yes
---------------
Jacob Skaria


"ejack" wrote:

I am trying to determine a previous row number in a chart like this --
.
.
.
xxx xxx data xxx xxx xxx xxx xxx xxx
..................................xxx xxx xxx xxx
.
.
.
..................................xxx xxx xxx xxx (how many rows
back to data row?)
.
.
.

I would like to know the contents of the data and other cells in that row in
the lower rows. I can't figure out what key words to search for in the
discussion groups. Your help would be greatly appreciated.


Thanks Jacob, yes, you do understand that the subsequent rows will be
indented essentially. That looks like a basic code call. It has been years
since I had to use basic in my spreadsheets. Do you think it is necessary to
use basic?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Looking for a value in a previous row

OK, thanks Jacob. I tweaked it to =LOOKUP(2,1/(R1C1:RC1<""),R1C1:RC1) so it
is general to the current row, thanks again.

"Jacob Skaria" wrote:

The below formula will give you the next entry upwards in the range C1:C10..
=LOOKUP(2,1/(C1:C10<""),C1:C10)

So you can apply that in row 11...

If this post helps click Yes
---------------
Jacob Skaria


"ejack" wrote:



"Jacob Skaria" wrote:

If I understand you correctly; the data row will always be filled (especially
ColA,ColB,ColC) and for the current row these columns will not be filled.

In that case; the below code should give you the previous data row. Try and
feedback

Dim lngDataRow as Long
lngDataRow = Cells(Activecell.row, "C").End(xlUp).Row

If this post helps click Yes
---------------
Jacob Skaria


"ejack" wrote:

I am trying to determine a previous row number in a chart like this --
.
.
.
xxx xxx data xxx xxx xxx xxx xxx xxx
..................................xxx xxx xxx xxx
.
.
.
..................................xxx xxx xxx xxx (how many rows
back to data row?)
.
.
.

I would like to know the contents of the data and other cells in that row in
the lower rows. I can't figure out what key words to search for in the
discussion groups. Your help would be greatly appreciated.


Thanks Jacob, yes, you do understand that the subsequent rows will be
indented essentially. That looks like a basic code call. It has been years
since I had to use basic in my spreadsheets. Do you think it is necessary to
use basic?


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
3-Color Scale Vlookup for Current Month/Previous/Pre-Previous NeoFax Excel Discussion (Misc queries) 2 January 8th 10 07:04 PM
need previous row help [email protected] Excel Programming 6 March 6th 07 10:30 PM
previous day tigoda Excel Programming 4 October 17th 06 02:37 PM
Previous Month End Tristan Excel Discussion (Misc queries) 7 September 9th 06 12:25 PM
Previous Worksheet Leroy-P Excel Programming 2 October 12th 04 10:07 PM


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