+ Reply to Thread
Results 1 to 9 of 9

Creating conditional calculations

  1. #1
    Registered User
    Join Date
    12-04-2009
    Location
    Bromsgrove, England
    MS-Off Ver
    Excel 2003
    Posts
    53

    Creating conditional calculations

    I have a project (spreadsheet attached). Im going to be adding lots of data with a similar theme.

    In cell X there will be a number for the width and in cell Y a number for the length. On the sample sheet cell X is 508 and Y is 1.

    You will then see in cells F, H, I, S, AF, AG and BK it references the number 508 and 1. I want to create a formula or function whereby I can automatically input whatevers in cell X and Y.

    My initial thought is to replace 508 in F, H, I, S, AF, AG and BK with PRODUCTWIDTH and 1 in 508 in F, H, I, S, AF, AG and BK with PRODUCTLENGTH. Then make a formula that will automaticlaly change the word PRODUCTWIDTH to whats in cell X and PRODUCTLENGTH to whats in cell Y.

    Whats the best way to do this?
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Creating conditional calculations

    As you describe... you have a few examples of this technique already in your prior threads I think, no ?

    In general terms:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-04-2009
    Location
    Bromsgrove, England
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Creating conditional calculations

    Hi

    On the previous threads I've pulled the text description from a seperate sheet, whereas all the descriptions are in there so Ill need to overwrite the actual cells now so didnt think that would work. If that makes any sense?

  4. #4
    Registered User
    Join Date
    12-04-2009
    Location
    Bromsgrove, England
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Creating conditional calculations

    Just to try and explain a little more. I would need something that I would paste over the top of a cell to say substitute PRODUCTWIDTH with cell X2 and substitute PRODUCTLENGTH with cell Y2. Ive adjusted and re attached the spreadsheet to show what I mean, all the relevant areas say either PRODUCTWIDTH or PRODUCTLENGTH and I want be be able to easily change these words to whatever it says in X2 or Y2
    Attached Files Attached Files
    Last edited by visionwindowfilms; 12-06-2010 at 09:37 AM.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Creating conditional calculations

    Apologies for belated response - man flu has struck for the upteenth time this year.

    To overwrite the original constants you would be looking at VBA, eg:

    Please Login or Register  to view this content.
    Caveat: I'm up to my eyeballs on meds so I've little doubt the above can be improved upon.

  6. #6
    Registered User
    Join Date
    12-04-2009
    Location
    Bromsgrove, England
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Creating conditional calculations

    Great, so would I paste this code over each cell

  7. #7
    Registered User
    Join Date
    12-04-2009
    Location
    Bromsgrove, England
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Creating conditional calculations

    Ive tried pasting this over the cells and it doesnt seem to work, am I doing something wrong?

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Creating conditional calculations

    The "code" is VBA - to be stored within the VBE.

    Attached is your earlier sample with Code and trigger in place - click the Button to invoke the code which will update the various records per placeholders.

    In this instance (updating constants) VBA is required.

    note: file type is now .xlsm (macro enabled)

    For info. re: macro security in XL2007 etc see: http://office.microsoft.com/en-us/he...1071.aspx#BM12
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-04-2009
    Location
    Bromsgrove, England
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Creating conditional calculations

    Thanks very much for your help again

+ 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