Results 1 to 14 of 14

Formula based on cell value

Threaded View

  1. #11
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Formula based on cell value

    Here is my "best and final" offer.

    The caveats are:
    - The formula must be in the first (only) table on the spreadsheet.
    - The column containing the drop down list (column E in the example) can be named anything, but if named other than formula, modify the call to the function accordingly: =MakeFormula([@formula])
    - The formula must be in the column to the immediate right of the drop down list (column F in the example)
    - The answers will appear in the column to the immediate right of the formula (column G in the example)

    Again the restrictions keep from hard coding anything. Table name can be anything. You can have any number of columns and they can be named whatever you like. The drop down list can appear in any column as long as the two columns to the right are reserved as noted above.

    You can come up with any formula Excel allows. This application works at the Excel and not the VBA level as the previous version did.

    One more caveat. The sheet module for the sheet that contains the data table must have the following code:
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim TableName As String
    
    TableName = ActiveSheet.ListObjects(1).Name
    
    If Intersect(Target, Range(TableName & "[formula]")) Is Nothing Then Exit Sub
    
    ActivateFormula Target
    End Sub
    This code is the magic that converts the string returned by MakeFormula into a "real" formula.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 11-19-2018, 01:52 AM
  2. [SOLVED] Conditional Formatting formula to color one cell based on a date range in another cell
    By katiedee1625 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-27-2018, 08:52 AM
  3. Replies: 3
    Last Post: 10-19-2016, 08:43 AM
  4. Replies: 0
    Last Post: 03-20-2014, 10:57 AM
  5. Replies: 2
    Last Post: 02-01-2013, 01:57 PM
  6. [SOLVED] Formula question-change formula based cell calling it?
    By seethesun in forum Excel General
    Replies: 2
    Last Post: 02-08-2009, 01:39 PM
  7. Replies: 0
    Last Post: 02-11-2005, 02:06 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