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: 1
Default function called from worksheet and bad result!

Hi,
in a worksheet "test" with autofilter mode, I'm using the formula:

=nb_row_aera(1)

which refers to my VBA function :

Function nb_row_area(n as Long) As Long
nb_row_area
Worksheets("test").AutoFilter.Range.SpecialCells(x lCellTypeVisible).Areas(n).Rows.Count
End Function

the problem is that the result is always the nb of rows in the initia
range for Autofilter even if filters are activated in the worksheet!
On the contrary, the same code placed into a macro provides goo
results!!!

Sub Pr_nb_row_area()
n = 1
MsgBo
Worksheets("test").AutoFilter.Range.SpecialCells(x lCellTypeVisible).Areas(n).Rows.Count
End Sub

Why and how should I modify the function

--
Message posted from http://www.ExcelForum.com

 
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
Incorrect result using NPER worksheet function KG Old Wolf Excel Worksheet Functions 7 November 3rd 08 02:49 AM
How do I display the result of a function on seperate worksheet e. Beth Excel Worksheet Functions 3 July 15th 08 05:30 AM
Link a cell from another worksheet as a result in a function? LisaLisaKK Excel Worksheet Functions 1 September 7th 06 06:47 PM
How can I put result of If worksheet function into a different cel Janice Excel Worksheet Functions 1 August 30th 05 08:01 PM
Possible to know who has called a function ? Isabelle Robin Excel Programming 3 March 5th 04 12:33 AM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"