Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do i find the last entry in a column where every cell is not .

I have an excel worksheet that keeps track of our gas inventory. We get gas
delivered once a week and when its delivered we post the price. I wind up
with a column that has prices and non entries. Month End i need the LAST
price we were charged to produce a report. It would be nice if Visual Basic
had a function called Last but alas I have not found it. I have to do a lot
of gyrations to get this data. Does someone know an easy way to get this data.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How do i find the last entry in a column where every cell is not .

Hi Beau Black,

Try:

Sub Tester()
Dim LastPrice As Double
Const Col As String = "A" '<<===== CHANGE
LastPrice = Cells(Rows.Count, Col).End(xlUp).Value
MsgBox LastPrice '<<==== For Test
purposes only
End Sub


Change the value of Col to accord with your column.

---
Regards,
Norman



"Beau Black" <Beau wrote in message
...
I have an excel worksheet that keeps track of our gas inventory. We get gas
delivered once a week and when its delivered we post the price. I wind up
with a column that has prices and non entries. Month End i need the LAST
price we were charged to produce a report. It would be nice if Visual
Basic
had a function called Last but alas I have not found it. I have to do a
lot
of gyrations to get this data. Does someone know an easy way to get this
data.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default How do i find the last entry in a column where every cell is not .

Hi

Adding: If you by Last mean "last entered, but not necessarily downmost"
then you need a date-time-stamp or similar in the neighbor column.

HTH. Best wishes Harald

"Beau Black" <Beau skrev i melding
...
I have an excel worksheet that keeps track of our gas inventory. We get

gas
delivered once a week and when its delivered we post the price. I wind up
with a column that has prices and non entries. Month End i need the LAST
price we were charged to produce a report. It would be nice if Visual

Basic
had a function called Last but alas I have not found it. I have to do a

lot
of gyrations to get this data. Does someone know an easy way to get this

data.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default How do i find the last entry in a column where every cell is not .


Well the easiest way out:

1. In the worksheet, chose a conveninet cell where you want to display
the last price enter. Name this cell as "LastPrice".

2. In that worksheet_change event procedure add following code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
Range("LastPrice").Value = Target.Value
End If
End Sub

Above is assuming price is in coloumn 6 (F). Change the coloumn number
accordingly.

Sharad


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for 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
Find first entry in a column AJ[_4_] Excel Discussion (Misc queries) 1 July 31st 08 09:17 PM
In a column of numbers I need a function to find the last entry Charlie Bamford Excel Worksheet Functions 4 May 13th 06 09:05 PM
How do I find a column entry closest to a particular value feman007 Excel Worksheet Functions 2 March 9th 05 03:48 PM
How do I find a column entry closest to a particular value feman007 Excel Discussion (Misc queries) 1 March 8th 05 10:22 PM
Function to Find Last Non-Null Entry in a Column Brad H McCollum Excel Programming 1 August 5th 03 04:59 AM


All times are GMT +1. The time now is 09:12 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"