LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default user defined function which increase consecutively while passingbelow cells

Hi Claus,

I wrote the function. I am very greatful for your help. Thank you very much for giving your time. This was very helpful for me. The function is like below.The function has one requirement: It has to be initially stated in the first row.

Function myfunc(x As Range, Optional rowno As Range)
If rowno Is Nothing Then Set rowno = Application.Caller
rx = x.Rows.Count
a1 = (rowno.Row - 1) Mod (rx + 1)
a2 = Int((rowno.Row - 1) / rx) + 1
myfunc = Application.WorksheetFunction.Index(x, a1, a2)
End Function


Again thanks a lot.
 
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
Cells w/ user defined function do not auto update John Excel Worksheet Functions 2 September 14th 08 07:06 PM
Making Changes to Cells from a user defined function Elliot[_3_] Excel Programming 3 September 29th 06 04:39 AM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM
Obtaining column/row numbers of cells in user defined function GreenInIowa Excel Programming 6 October 19th 05 09:20 PM


All times are GMT +1. The time now is 12:34 AM.

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"