+ Reply to Thread
Results 1 to 4 of 4

Make UDF function flexible to any sheet

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Make UDF function flexible to any sheet

    Hello everybody
    I have devised this udf function that brings the address of the last non zero of specific range
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    It is working well but for the activesheet only
    How it can be fixed to deal with any sheet specified in the parameters ..or I imagine
    Please Login or Register  to view this content.
    If Sheet1! existed so the function would deal with Sheet1 and if missing to deal with the active sheet
    I tried to fix it but I failed

    Thanks advanced for any help
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Make UDF function flexible to any sheet

    try (untested)
    Please Login or Register  to view this content.
    If you only write Cells( ...) it will give you the references on the activesheet. rng.parent = the sheet from the range, so I added that. See how it works, no other changes..

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Make UDF function flexible to any sheet

    Mr. Berlan
    I struggled for two hours trying to fix it and you fixed it in a minute with just one magic word "parent"
    Thank you very much for this great really great help
    Regards

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Make UDF function flexible to any sheet

    You're welcome buddy, and thanks for the kind feedback and rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 04-09-2015, 08:00 PM
  2. [SOLVED] InputBox Function not as flexible as needed
    By dystopianprotagonist in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-04-2013, 10:59 PM
  3. [SOLVED] How to make a flexible line chart in Excel
    By BNCOXUK in forum Excel General
    Replies: 3
    Last Post: 10-30-2012, 12:26 PM
  4. conditional sum: can I make the array flexible
    By jash147 in forum Excel General
    Replies: 4
    Last Post: 11-02-2007, 02:25 AM
  5. Replies: 1
    Last Post: 11-30-2005, 10:15 PM
  6. Can I make formulas more flexible?
    By George in forum Excel General
    Replies: 3
    Last Post: 11-08-2005, 01:40 PM
  7. [SOLVED] How to make a flexible cell reference?
    By Mar Vernooy in forum Excel General
    Replies: 2
    Last Post: 07-01-2005, 09:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1