Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Programming (https://www.askmehelpdesk.com/forumdisplay.php?f=437)
-   -   Calculator and transferation Exceldata (https://www.askmehelpdesk.com/showthread.php?t=108799)

  • Jul 11, 2007, 12:00 AM
    Roland1946
    Calculator and transferation Exceldata
    Can someone give me the code for a calculator for adding different numbers of values.
    For example 3+2+6+14+56+89= next time maybe I want to calculate 45+78+99+12+13+123+1000+6235=


    I also like to know how I can automatically choose a value in an Excelsheet and then
    put it automatically in a Textbox

    I am a beginner with a little experience.

    I use VB6
  • Jul 11, 2007, 12:49 AM
    Capuchin
    I'm not entirely sure what you are asking. Can you elaborate?
  • Jul 11, 2007, 01:38 AM
    Roland1946
    Actually from the program iI am just writingFor example I have a pressurevessel with
    100 holes with different diameters.I don't want to make 100 textboxes for that reason
    when I calculate the sum of those diameters
    Next time Maybe I have 50 different diameters and so on



    About Excel I want to get the value from a table in an Excelsheet and put it automatically in a textbox in my VB-program.
    For example vertically I have different profiles and horizontally I have different materials
    in my Excelsheet then I want to find the calculation value in the right cell and put it in a textbox in my VB-program

    I hope you understand it better now.
  • Jul 11, 2007, 04:18 AM
    Capuchin
    1. Use a listbox so that you can add as many results as you want, when it comes to adding them, take the last item from the listbox and add it to a total variable, then erase that item from the list. Keep doing this until the listbox is empty. You should be able to get the number of items in the listbox through one of the properties (I can't remember the exact property).

    2. You can easily do this in VBA, but iif you're using VB6 I don't know how to do it. I would recommend looking at seeing if you can do your application in VBA.

  • All times are GMT -7. The time now is 03:39 PM.