LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default UDF won't refresh - please help

Hello

I have a UDF to get the contents of the last cell in a column where those
contents are a number and not "". I first find the last cell which typically
will contain a formula but have it's value set to "" and then 'count back'
until I hit a cell which has a number.

My function works, but when I run a sub to refresh other calculations on my
sheet, my UDF does not refresh and #VALUE! occurs. Any help will be greatly
appreciated.

Thanks
Tarryn

My Function:

Function LASTCELL(input_range As Range, n As Integer)
Application.Volatile True

col_number = input_range.Column

last_row = Cells(Rows.Count, col_number).End(xlUp).Row

Do Until Application.WorksheetFunction.IsNumber(Cells(last_ row,
col_number).Value)

last_row = last_row - 1

Loop

LASTCELL = Cells(last_row - n, col_number)


 
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
Copy Excel functions formula and auto refresh refresh Pauline Cheong Excel Worksheet Functions 3 February 16th 09 01:23 AM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) Anant[_2_] Excel Programming 1 August 6th 03 04:22 AM


All times are GMT +1. The time now is 10:40 AM.

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"