![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
here's an example:
Column A-N contains month end header (jan -dec). row 1 has values for each month. Is there a formula in Column O that would show the last value entered in columns A-N? |
|
|
|
#2 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Your could put the following function in a normal module in your workbook:
Function LASTINROW(rngInput As Range) As Variant Dim WorkRange As Range Dim i As Integer, CellCount As Integer Application.Volatile Set WorkRange = rngInput.Rows(1).Columns("a:n") Set WorkRange = Intersect(WorkRange.Parent.UsedRange, WorkRange) CellCount = WorkRange.Count For i = CellCount To 1 Step -1 If Not IsEmpty(WorkRange(i)) Then LASTINROW = WorkRange(i).Value Exit Function End If Next i End Function Then enter the following formula in o1: =LASTINROW(A1:N1) Hope that helps. Cheers, Nate [ This Message was edited by: nateo on 2002-03-11 11:07 ] |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
=INDEX(A5:N5,MATCH(9.99999999999999E+307,A5:N5)) |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|