+ Reply to Thread
Results 1 to 6 of 6

Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    Gainesville, FL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

    Could use some help with Excel calculating Unit of Measure forwards and backwards for inventory purposes. For example;

    A1 = Metal1
    B1 = Sq. Ft. On-Hand
    C1 = Sheets On-Hand
    D1 = Packs On-Hand

    where C1 = B1/10
    where D1 = C1/10

    Want to allow user three count and enter possibilities:
    If user enters On-Hand data in B1, VBA calculates C1 & D1
    If user counts sheets & then enters On-Hand data in C1, VBA calculates B1 & D1
    If user counts packs & then enters On-Hand data in D1, VBA calculates B1 & C1

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

    Hi,

    You'll need a macro. Specifically a sheet change macro, something like...
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

    Try the attached. Macros must be enabled for this to work.
    Attached Files Attached Files
    Gary's Student

  4. #4
    Registered User
    Join Date
    01-21-2013
    Location
    Gainesville, FL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

    Both demo codes worked just fine for a single line of data. What is the easiest way to apply sheet changee macro code as written if there are multiple rows of data each with different conversion factors? Example:

    A2 = Metal2
    B2 = Sq. Ft. On-Hand
    C2 = Sheets On-Hand
    D2 = Packs On-Hand

    where C2 = B2/8
    where D2 = C2/8

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

    Hi
    Try the following as an example of an entry in column B which adds formulas to C & D
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-21-2013
    Location
    Gainesville, FL
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming

    Hi Very Smart guys... The second example didn't seem to work. Any additional thoughts on VBA for:
    A1 = Metal1
    B1 = Sq. Ft. On-Hand
    C1 = Sheets On-Hand
    D1 = Packs On-Hand

    where C1 = B1/10
    where D1 = C1/10

    Want to allow user three count and enter possibilities:
    If user enters On-Hand data in B1, VBA calculates C1 & D1
    If user counts sheets & then enters On-Hand data in C1, VBA calculates B1 & D1
    If user counts packs & then enters On-Hand data in D1, VBA calculates B1 & C1

    A2 = Metal2
    B2 = Sq. Ft. On-Hand
    C2 = Sheets On-Hand
    D2 = Packs On-Hand

    where C2 = B2/8
    where D2 = C2/8

    A3 thru A99 would all also need to be independent conversion factors

    Thank you very much for looking at it and offering help!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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