Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Looking for formula that selects last value entered in a column?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Looking for formula that selects last value entered in a column?

Here is a subroutine that does it:
Sub OneColLastRow()

If Range("A" & Rows.Count).End(xlUp) = "" Then GoTo Finish

'give the last row
myrow = Range("A" & Rows.Count).End(xlUp).Row
Cells(myrow, "A").Select
Exit Sub

Finish:
MsgBox "No formulas or data found"
End Sub

This is adapted from http://vbaexpress.com/forum/showthread.php?t=9774

Need help with VBA? See David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"playgolf" wrote in message
...



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default Looking for formula that selects last value entered in a colum

Here's a formula as you asked for one

=INDIRECT(ADDRESS(COUNTA(D4:D500)+3,4))

It assumes that you have headers in the first three rows and you want the
last value in column D

Regards

Peter

"Bernard Liengme" wrote:

Here is a subroutine that does it:
Sub OneColLastRow()

If Range("A" & Rows.Count).End(xlUp) = "" Then GoTo Finish

'give the last row
myrow = Range("A" & Rows.Count).End(xlUp).Row
Cells(myrow, "A").Select
Exit Sub

Finish:
MsgBox "No formulas or data found"
End Sub

This is adapted from http://vbaexpress.com/forum/showthread.php?t=9774

Need help with VBA? See David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"playgolf" wrote in message
...




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
How to write macro that selects relative locations NewKid Excel Worksheet Functions 2 September 12th 06 07:41 PM
How do I change data that has been entered in a column to a row? ryoung Excel Discussion (Misc queries) 2 June 23rd 05 07:56 PM
how can I get the last value entered into an excel column to disp. taylord Excel Worksheet Functions 2 March 24th 05 08:57 PM
Eliminating "Selects" Adam1 Chicago Excel Discussion (Misc queries) 2 March 2nd 05 02:37 AM
mouse selects area Todd Excel Worksheet Functions 3 January 21st 05 09:20 PM


All times are GMT +1. The time now is 07:27 PM.

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"