Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default reference a cell above the last cell

How do I reference the cell above the last cell in a column?? I know how to
figure out the last cell, but I'm not sure how to subtract the last cell by
the one right above it.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default reference a cell above the last cell

Conny,

Try something like the following. Change the "A" to whatever column you want
to test.

Dim R As Range
Set R = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)
If R.Row < 1 Then
Set R = R(0, 1)
End If
R.Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"conny" wrote in message
...
How do I reference the cell above the last cell in a column?? I know how
to
figure out the last cell, but I'm not sure how to subtract the last cell
by
the one right above it.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default reference a cell above the last cell

By the way this is for automation, so i'm making formulas, where one
references the last cell and this last cell will change every week, so I want
to figure out how to make it so I can subtract the last cell by the number in
the cell just above.

"conny" wrote:

How do I reference the cell above the last cell in a column?? I know how to
figure out the last cell, but I'm not sure how to subtract the last cell by
the one right above it.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default reference a cell above the last cell

Check the answers to your previous post.

Please stay in your original thread to avoid others from duplicating and
wasting their efforts!
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"conny" wrote in message
...
How do I reference the cell above the last cell in a column?? I know how

to
figure out the last cell, but I'm not sure how to subtract the last cell

by
the one right above it.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default reference a cell above the last cell

sorry... but where do i go to do all this... my column is t, so that's the
column i would use, I understand that part. But where do I do this dim R and
Set R= stuff. If you could help me out with this I would really appreciate
it. Thanks.

"Chip Pearson" wrote:

Conny,

Try something like the following. Change the "A" to whatever column you want
to test.

Dim R As Range
Set R = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)
If R.Row < 1 Then
Set R = R(0, 1)
End If
R.Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"conny" wrote in message
...
How do I reference the cell above the last cell in a column?? I know how
to
figure out the last cell, but I'm not sure how to subtract the last cell
by
the one right above it.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default reference a cell above the last cell

The code I posted creates a variable named 'R' of type Range and then sets
that variable to point to the cell above the last cell. Once you have that
reference, you can get its address with the Address property, read or change
the cell value with the Value property, or any of many other operations. If
you are building a formula, you will probably want to get the Address of R
and put that in your formula.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"conny" wrote in message
...
sorry... but where do i go to do all this... my column is t, so that's the
column i would use, I understand that part. But where do I do this dim R
and
Set R= stuff. If you could help me out with this I would really
appreciate
it. Thanks.

"Chip Pearson" wrote:

Conny,

Try something like the following. Change the "A" to whatever column you
want
to test.

Dim R As Range
Set R = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)
If R.Row < 1 Then
Set R = R(0, 1)
End If
R.Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"conny" wrote in message
...
How do I reference the cell above the last cell in a column?? I know
how
to
figure out the last cell, but I'm not sure how to subtract the last
cell
by
the one right above it.



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
absolute cell reference A spreadsheet cell reference that does no help Excel Discussion (Misc queries) 1 January 18th 06 06:56 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 10:40 PM.

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"