+ Reply to Thread
Results 1 to 2 of 2

Automatic Unit Conversions

  1. #1
    Registered User
    Join Date
    03-15-2017
    Location
    Florida
    MS-Off Ver
    Florida
    Posts
    11

    Automatic Unit Conversions

    Hi guys....got lots of help here with a cell formula last week and now I have another issue.......

    In my pump spreadsheet, I currently have two cells for a user to input a required flow rate, one for l/min and one for gal/min. The user can enter a value in either cell, and the other one automatically converts the value. I am using the following VB program to allow this:

    Application.EnableEvents = False
    Select Case Target.Address
    Case "$G$8": [G9] = [G8] * 0.26417
    Case "$G$9": [G8] = [G9] / 0.26417
    End Select
    Application.EnableEvents = True


    Now, I want to give the user a third possible input flow rate cell, m3/hr, and have it adjust the other two cells. Likewise, if either of the first two cells are changed, I want this cell to update. I have an idea on how to do this but I am and excel and VB novice so I figured this was the best place to get help.

    Thanks in advance guys!

  2. #2
    Registered User
    Join Date
    03-15-2017
    Location
    Florida
    MS-Off Ver
    Florida
    Posts
    11

    Re: Automatic Unit Conversions

    Figured it out.....had to tie the new cell to both prior cells and the conversions. Not sure if there is a more simpler method but this one works:

    Application.EnableEvents = False
    Select Case Target.Address
    Case "$G$8": [G9] = [G8] * 0.26417
    Case "$G$9": [G8] = [G9] / 0.26417
    End Select
    Application.EnableEvents = True
    Application.EnableEvents = False
    Select Case Target.Address
    Case "$G$9": [G10] = [G9] * 0.22713
    Case "$G$10": [G9] = [G10] / 0.22713
    End Select
    Application.EnableEvents = True
    Application.EnableEvents = False
    Select Case Target.Address
    Case "$G$8": [G10] = [G8] * 0.06
    Case "$G$10": [G8] = [G10] / 0.06
    End Select
    Application.EnableEvents = True

+ 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. display unit on axis (unit that's less than 1)
    By hoda in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-21-2016, 08:16 PM
  2. Replies: 4
    Last Post: 10-07-2015, 06:04 AM
  3. Automatic conversions
    By Greg7976 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-12-2014, 10:27 PM
  4. [SOLVED] Unit increase relative to variable unit thresholds
    By Fr3dle in forum Excel General
    Replies: 6
    Last Post: 07-01-2013, 06:57 AM
  5. Replies: 3
    Last Post: 12-27-2012, 01:20 PM
  6. Help w/ Unit Conversions
    By xxxombie88 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-23-2012, 01:36 AM
  7. Automatic calculation of cheapest unit price with bulk discounts
    By whirlwind1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-18-2011, 08:20 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