Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All, FYI, I have been using the following (offered by Jim Thomlinson in 2006)
without trouble for years: Function fnLastCol(sh As Worksheet) As Long On Error Resume Next fnLastCol = sh.Cells.Find(what:="*", _ After:=sh.Range("A1"), _ LookAt:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Column On Error GoTo 0 End Function Recently however, I received a worksheet from a colleague structured as: A:AK populated, AL:AY empty, AZ:BA populated So the function should have returned 53 (BA) but was in fact returning 37 (AK) . Only when I noticed that columns J:AK were grouped and removed the grouping could I make the function behave as I expected. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
finding the largest value for a name in a column and then returningthe result from a different column | Excel Worksheet Functions | |||
Finding Info from Column A and Removing it from Column B | Excel Discussion (Misc queries) | |||
Finding the closest number in column A and take the value in column B | Excel Worksheet Functions | |||
Output from a userform finding the right column. column | Excel Programming | |||
finding and reporting in column A, where a series of column reaches zero | Excel Programming |