+ Reply to Thread
Results 1 to 3 of 3

Macro to run one formula for range of cells by clicking on cell

  1. #1
    Registered User
    Join Date
    08-25-2014
    Location
    Atlanta, GA
    MS-Off Ver
    2010
    Posts
    6

    Macro to run one formula for range of cells by clicking on cell

    Hello,

    I was wondering if there was a code that could be written so that whenever I click on a cell, a formula would automatically run. I've searched for this on the internet, but I can only find examples where the formula is applicable to only one cell. In my case, I'd like to be able to click on any one cell in a block of 264 cells and be able to run a formula for the criteria associated with that cell (ie: the column and row headers).

    Attached is what a screenshot of what I currently have. I apologize that I'm not able to post the spreadsheet since it has confidential company information. I'd like to be able to click on any cell in the A10:L33 range and have it apply the same criteria as listed in the Month Detail Inquiry boxes starting on A37 and return the same result, row 1562. The screenshot shows that I'm drilling down into what's making up the balance in cell B25. However, currently the user has to input the Account number and Start Date to drill down into a balance. Does anyone know if I can set up a macro to apply the same criteria to pull the information rather than typing in the information in cells B38:B39?

    The formulas in cells A1562 and N1562 are:

    =IF(AND('Report 1'!E1521>=$B$39,'Report 1'!E1521<$B$40+1,'Report 1'!F1521=$B$38,'Report 1'!C1521=$B$3)=TRUE,'Report 1'!G1521,"N/A")

    =IF(AND('Report 1'!E1521>=$B$39,'Report 1'!E1521<$B$40+1,'Report 1'!F1521=$B$38,'Report 1'!C1521=$B$3)=TRUE,'Report 1'!H1521,"N/A")

    Report 1 is the data source and contains all raw data that is being pulled into the table.

    I hope that makes sense. Let me know if you have any questions.

    Thanks!Spreadsheet Screenshot.docx

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,264

    Re: Macro to run one formula for range of cells by clicking on cell

    What you are describing is a built-in feature of Excel - use a pivot table, and double-click any data cell to create a new sheet with all the data that was used to create the point of interest.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro to run one formula for range of cells by clicking on cell

    Without the spreadsheet I can't do much however you could use the code below to run each time you select a cell within a given range.

    Please Login or Register  to view this content.
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

+ 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. Clicking from one cell to another causes a range
    By aray563 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-05-2014, 03:46 PM
  2. Replies: 0
    Last Post: 08-08-2012, 01:02 PM
  3. macro automatically clicking links in cells
    By akxander in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-30-2009, 02:13 PM
  4. Macro starts on clicking only certain column cells
    By msaz87 in forum Excel General
    Replies: 6
    Last Post: 03-07-2008, 04:31 AM
  5. [SOLVED] see the cells the formula relates to by double clicking the cell
    By pvagolfer in forum Excel General
    Replies: 1
    Last Post: 05-15-2005, 08:06 PM

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