View Single Post
  #2   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

use something like these stataements

Dim lastrow As Range
Dim myrange As Range
Set lastrow = Range("a60000").End(xlUp)
Set myrange = Range(lastrow, lastrow.Offset(-20, 0))
MsgBox myrange.Address

you will get last 21 rows in column A


Jeff wrote in message
...
Guys,
I have a spreadsheet with timestamps on col A, then Col B contains the
values correspond to timestamps in ColA (Col C thru Col M are similar to

Col
B as well). I am trying to build a chart in function of time (meaning
Values for the X axis would be B2..M2, and Y axis would be B3..M3 for the

1
series, then B3..M3 for the values in x-axis, and B4..M4 for Y axis, so
on...).
Number of rows is subject to change (time stamp entries), and I am only
interested for the last 21 entries (if there is less than 21 entries, plot
them all, otherwise, only plot the last 21 entries). For Instance, if

there
are 23 rows of data, the 1st series would be data on row3 Col B to Col M;

the
2nd series would be from Row4 ColB to Col M.. the 21st series would be

from
Row 23 ColB Col M. If there are less that 21 rows, say, 5. Then 1st

series
would be Row1 ColB to Col M; 2nd series would be Row2 ColB to ColM... 5th
series = Row5 ColB..ColM.
Can someone please help me with the equation (offset?) in name

definition?

Thanks
Jeff