Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
absolute cell reference A spreadsheet cell reference that does no | Excel Discussion (Misc queries) | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) | |||
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions |