Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-30-2010, 03:16 PM
BjornS BjornS is offline lastincolumn function Windows Vista lastincolumn function Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi,
I get i little puzzled when I see you function LastInRange.
Isn't your intention to get an answer of let's say 50, it the last number if 50 rows down?
Is there any special reason to why you check for numeric values only?
What is the explanation to why you have written LastInRange = "" at the end? This will always give an empty answer back.

I tried this code instead (see below). Both this and yours is fast. How long time does the function take when you use it?

Best regards
Bjorn


Function LastInRange2(InputRange As Range)
Dim CellCount As Long
Dim i As Long
CellCount = InputRange.Count
For i = CellCount To 1 Step -1
If Not IsEmpty(InputRange(i)) And IsNumeric(InputRange(i)) Then
LastInRange2 = i
Exit Function
End If
Next i
End Function
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross-reference function with Visio? Barometer Word 0 11-04-2009 12:38 PM
Outlook 2003/ Send to function ptservice Outlook 0 09-24-2009 07:09 AM
lastincolumn function Help! for using an appropriate function/Macro in Excel pawan2paw Excel 1 06-04-2009 12:28 PM
lastincolumn function Need help on what function to use??? Primeraman Excel 1 06-13-2006 10:16 AM
Help with Combination function sanasath Excel 0 12-13-2005 07:24 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft