+ Reply to Thread
Results 1 to 4 of 4

Thread: Help!!

  1. #1
    Registered User
    Join Date
    01-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Help!!

    Hello All,

    I am new to this forum and would be grateful for some input.

    I understand that there is an issue with sumif/averageif/countif that should they be used on an external link and the corresponding file is closed, one gets an #NA. This is because these functions only work with active files and not with closed external links.

    Given this, I have basically designed an Excel vba macro which in any workbook loops over each worksheet and:

    1) searches for any occurences of sumif/averageif/countif and should it find one,
    2) it checks whether the found sumif/averageif/countif function takes any external links, if so,
    3) the macro copes and pastes this cell in as values

    I hope this makes sense.

    Within my macro, I search for sumif/averageif/countif using the following line of code:

    ActiveSheet.Cells.Find(What:="SUMIF", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
    xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
    , SearchFormat:=False)


    The problem is that if a worksheet has used sumif/averageif/countif alot then this searching takes alot of time as I have placed this line of code within a while loop which means it loops until there is no occurence left of sumif/averageif/countif.

    My question is that, does someone has a quicker way of doing this?

    Thanks for your help!
    IpMan
    Last edited by IpMan; 01-10-2012 at 07:24 PM.

  2. #2
    Registered User
    Join Date
    01-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help needed with macro which finds sumif/averageif/countif

    anyone? is there a quicker way to do this somehow..as opposed to searching cell by cell..?

  3. #3
    Registered User
    Join Date
    01-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help!!

    cough cough..

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Help!!

    I don't know of another way.

    Please take a few minutes to read the forum rules about thread titles.

    Thanks.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0