Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Last cell with constant in a sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Last cell with constant in a sheet


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Last cell with constant in a sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Last cell with constant in a sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Last cell with constant in a sheet

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
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
The cell currently being evaluated contains a constant Frustrated Excel Discussion (Misc queries) 1 March 15th 10 04:42 AM
text in a cell invoke constant date in another cell - how Frode Inge Helland Excel Discussion (Misc queries) 1 September 18th 08 09:25 PM
Is there a way to set a cell value to be constant in formulas? Marshall Excel Worksheet Functions 4 November 2nd 07 04:29 PM
Constant cell Aurora Excel Worksheet Functions 1 February 14th 06 03:08 PM
Pasting constant formula where referral sheet changes Nicole M. Excel Worksheet Functions 10 January 1st 06 07:54 PM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"