1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Other Excel Help

Discussion in 'Software' started by David, 18 Jul 2012.

  1. David

    David μoʍ ɼouმ qᴉq λon ƨbԍuq ϝʁλᴉuმ ϝo ʁԍɑq ϝμᴉƨ

    Joined:
    7 Apr 2009
    Posts:
    17,461
    Likes Received:
    5,870
    I want to knock up a simple quantity calculator, that I can stick on the local shared drive for other people to access.

    This is the kind of layout I'm basing it on:

    [​IMG]

    Although, I need to include an output field.

    The problem is, I'm clueless as to how to get it to work. i.e. applying code to the appropriate fields in the form. Also, is it possible to restrict the view to the only that form when the spreadsheet is opened?

    I'm not looking for someone to do it all for me (that would be bare-faced cheek), I just don't know where to start.

    Can one of you guys help me out?

    Best regards

    Dave
     
    Carrie likes this.
  2. GMC

    GMC Minimodder

    Joined:
    26 Jun 2010
    Posts:
    1,502
    Likes Received:
    36
    whats your underlying formula?

    Are all the cells you specify mandatory or are you trying to create a calculation that will fill in any blank based on what is not entered?
     
  3. David

    David μoʍ ɼouმ qᴉq λon ƨbԍuq ϝʁλᴉuმ ϝo ʁԍɑq ϝμᴉƨ

    Joined:
    7 Apr 2009
    Posts:
    17,461
    Likes Received:
    5,870
    Just the three measurements multiplied by relative density to produce a tonnage figure.

    e.g. 4m x 3m x 150mm = 1.8 cu. metres

    1.8cu. x 1.5 tonnes per cu metre = 2.7 tonnes

    I will eventually want it to fill in blanks for backwards calculations but, as I said, I want to understand how to do it so I can add to and develop it as I need to.

    I'm just at a loss where to start.
     
  4. GMC

    GMC Minimodder

    Joined:
    26 Jun 2010
    Posts:
    1,502
    Likes Received:
    36
    Formule is just a straightforward math calculation from what you describe so guessing that is not the stumbling block, but
    =SUM((lengthref*widthref*depthref)*density)

    As to reverse calculations - look up excel help under 'goal seek' - that should help you a bit with blank filling activities. If you have multiple potential blanks then look into cell validations of a conditional statement to advise users if more than one cell is empty.

    You could do this with a straight sheet and cell protection locking the users out of cells you don't want fiddling with. - pass protect the cell protect/sheet and you're good to go. No need to complicate the scenario with forms.

    If it's a reference tool that is likely to be used a lot you could actually sign up for appinventor, knock together a simple app and provide the apk... might be easier to reference for the user (if they have an android)

    sorry if I've misunderstood or this seems brief - running out the door to get to a meeting.
     
  5. David

    David μoʍ ɼouმ qᴉq λon ƨbԍuq ϝʁλᴉuმ ϝo ʁԍɑq ϝμᴉƨ

    Joined:
    7 Apr 2009
    Posts:
    17,461
    Likes Received:
    5,870
    Thanks for the reply.

    You are correct - the calculations are straightforward, and not a problem. I just wanted to produce it as a form because I'll eventually add a drop-down box listing the various materials, that will auto-populate the relative density field when selected.

    Cheers :)
     
  6. Flibblebot

    Flibblebot Smile with me

    Joined:
    19 Apr 2005
    Posts:
    4,829
    Likes Received:
    297
    GMC, why do you need the =SUM() part of your formula? There's no actual SUM taking place.

    I'd agree with you about the form though - it could be done much more easily using a basic spreadsheet with locked & hidden cells.

    EDIT: Spreadie, you can use drop downs in Excel too - if you're using 2007 or 2010, look at Data Validation on the Data tab and choose List as the "Allow" option for the validation criteria. Point the list source to your possible materials list, then use a VLOOKUP to the same list to get the relative density figure for your calculation.
     
  7. Carrie

    Carrie Multimodder

    Joined:
    18 Nov 2010
    Posts:
    3,183
    Likes Received:
    992
    Backward calcs I'll leave to you but this is a basic calculator (you could bypass the volume calcuator step and build it into final density calculation I think. I set it up this way to prove the volume calculation.

    [​IMG]


    Private Sub CalculateVolume_Click()
    Volumetxtbox.Value = Length.Value * ItemWidth.Value * (Depth.Value / 1000)
    End Sub

    Private Sub CalculateRelativeDensity_Click()
    RelativeDensity.Caption = Volumetxtbox.Value * Materials.Value
    End Sub

    Materials.Value is Column 1 (not displayed on the calculator) of 2 selected where column 1 is bound which holds the density value from the named range in the spreadsheet.

    If it's the kind of thing you're looking for pm me your email address and I'll send the file over to you so you can see the property values and take it from there.
     
    Last edited: 19 Jul 2012
  8. David

    David μoʍ ɼouმ qᴉq λon ƨbԍuq ϝʁλᴉuმ ϝo ʁԍɑq ϝμᴉƨ

    Joined:
    7 Apr 2009
    Posts:
    17,461
    Likes Received:
    5,870
    Thanks Carrie, you're a star. If you like, I'll let you borrow my Karcher when you wash Tel's car. :lol:

    PM inbound
     
  9. Carrie

    Carrie Multimodder

    Joined:
    18 Nov 2010
    Posts:
    3,183
    Likes Received:
    992
    You're welcome. But no thanks to the Karcher, he can wash his own car :p
     
  10. Shirty

    Shirty W*nker! Super Moderator

    Joined:
    18 Apr 1982
    Posts:
    12,937
    Likes Received:
    2,058
    Why do I imagine Tel driving this?

    [​IMG]

    :lol:
     
  11. Carrie

    Carrie Multimodder

    Joined:
    18 Nov 2010
    Posts:
    3,183
    Likes Received:
    992
    Lol, no idea at all ;)

    Spreadie, YGEM. If you've got any questions just let me know.
     
    Apophis54 likes this.
  12. Teelzebub

    Teelzebub Up yours GOD,Whats best served cold

    Joined:
    27 Nov 2009
    Posts:
    15,796
    Likes Received:
    4,484

    Wheres the flames?
     
    Apophis54 likes this.
  13. Shirty

    Shirty W*nker! Super Moderator

    Joined:
    18 Apr 1982
    Posts:
    12,937
    Likes Received:
    2,058
    I told you you should have used waterproof decals instead of letting them all wash off in the rain :wallbash:
     
    Apophis54 likes this.
  14. David

    David μoʍ ɼouმ qᴉq λon ƨbԍuq ϝʁλᴉuმ ϝo ʁԍɑq ϝμᴉƨ

    Joined:
    7 Apr 2009
    Posts:
    17,461
    Likes Received:
    5,870
    Good grief, that is lush. :jawdrop:
     
  15. Carrie

    Carrie Multimodder

    Joined:
    18 Nov 2010
    Posts:
    3,183
    Likes Received:
    992
    Just realised I forgot your other question - open form automatically.

    In MVB double click on Thisworkbook (in the project window). It'll open up a code window for the workbook. Enter:

    Private Sub Workbook_Open()
    UserForm1.Show
    End Sub

    And the form will automatically open when the file opens :)
     
    Last edited: 19 Jul 2012
    David and Shirty like this.
  16. David

    David μoʍ ɼouმ qᴉq λon ƨbԍuq ϝʁλᴉuმ ϝo ʁԍɑq ϝμᴉƨ

    Joined:
    7 Apr 2009
    Posts:
    17,461
    Likes Received:
    5,870
    Thanks Carrie. :)
     
  17. Shirty

    Shirty W*nker! Super Moderator

    Joined:
    18 Apr 1982
    Posts:
    12,937
    Likes Received:
    2,058
    Rep to you Carrie, I learned a couple of things I didn't know there.

    Also, this thread is extremely hammer heavy :)
     
  18. Carrie

    Carrie Multimodder

    Joined:
    18 Nov 2010
    Posts:
    3,183
    Likes Received:
    992
    So did I shirty. I hadn't used MVB at all, I just thought I'd have a go ;) BUT before you (and Spreadie) panic I do know Excel extremely well and I did test it before posting :hehe:
     

Share This Page