PDA

View Full Version : Calculator and transferation Exceldata


Roland1946
Jul 11, 2007, 12:00 AM
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

Capuchin
Jul 11, 2007, 12:49 AM
I'm not entirely sure what you are asking. Can you elaborate?

Roland1946
Jul 11, 2007, 01:38 AM
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.

Capuchin
Jul 11, 2007, 04:18 AM
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.