Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am looking for code for finding the last cell with a constant in it (the cell in the lowest row and the rightmost column of the range displayed in Edit--Go to--Special--Constants.) Thanks in advance for the help. Regards, Raj |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Which of these, for instance, would be the last cell... C1223 or M1221 -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Raj" wrote in message Hi, I am looking for code for finding the last cell with a constant in it (the cell in the lowest row and the rightmost column of the range displayed in Edit--Go to--Special--Constants.) Thanks in advance for the help. Regards, Raj |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 13, 5:36 am, Raj wrote:
Hi, I am looking for code for finding the last cell with a constant in it (the cell in the lowest row and the rightmost column of the range displayed in Edit--Go to--Special--Constants.) Thanks in advance for the help. Regards, Raj Hi, I could write the code to accomplish this: Sub selectlastconstant() Dim rsprange As Range Set rsprange = Range("a1").SpecialCells(xlCellTypeConstants, 23) For Each rspcell In rsprange If rspcell.Row rsprowtrack Then rsprowtrack = rspcell.Row If rspcell.Column rspcoltrack Then rspcoltrack = rspcell.Column Cells(rsprowtrack, rspcoltrack).Select Next End Sub I look forward to comments on this code like drawbacks, limitations, etc Thanks, Raj |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 13, 5:36 am, Raj wrote:
Hi, I am looking for code for finding the last cell with a constant in it (the cell in the lowest row and the rightmost column of the range displayed in Edit--Go to--Special--Constants.) Thanks in advance for the help. Regards, Raj Hi, I could write the code to accomplish this: Sub selectlastconstant() Dim rsprange As Range Set rsprange = Range("a1").SpecialCells(xlCellTypeConstants, 23) For Each rspcell In rsprange If rspcell.Row rsprowtrack Then rsprowtrack = rspcell.Row If rspcell.Column rspcoltrack Then rspcoltrack = rspcell.Column Cells(rsprowtrack, rspcoltrack).Select Next End Sub Comments/Criticism welcome. Thanks, Raj |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Either loop over a SpecialCells range or:
Sub getolast() For Each r In ActiveSheet.UsedRange If IsEmpty(r) Or r.HasFormula Then Else Set rr = r End If Next If rr Is Nothing Then Else rr.Select End If End Sub -- Gary''s Student - gsnu200768 "Raj" wrote: Hi, I am looking for code for finding the last cell with a constant in it (the cell in the lowest row and the rightmost column of the range displayed in Edit--Go to--Special--Constants.) Thanks in advance for the help. Regards, Raj |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
The cell currently being evaluated contains a constant | Excel Discussion (Misc queries) | |||
text in a cell invoke constant date in another cell - how | Excel Discussion (Misc queries) | |||
Is there a way to set a cell value to be constant in formulas? | Excel Worksheet Functions | |||
Constant cell | Excel Worksheet Functions | |||
Pasting constant formula where referral sheet changes | Excel Worksheet Functions |