Buttons and Data Sheets

This project that I am trying to create was fairly easy for me to do in excel, however not knowing vb well I am having a hell of a time doing it in vb but this is a very fun and learning opportunity.

Now on to the next portion of my project. I want to create 2 buttons:

One button that will create a column that will combine with column3-5 and be added to the equation of Column 6

The other will create a column that will be added to other columns of its type and then create a Column of its averages.

example:
Cell 1 Job name
Cell 2 Cat name
Cell 3 A numeric value created by button 1
Cell 4 A numeric value created by button 1
Cell 5 A numeric value created by button 2
Cell 6 A numeric value created by button 2
Cell 7 (constant) gives average of the numeric values created by button 1
Cell 8 (constant) gives average of the numeric values created by button 2

(Note: Cell 7 and Cell 8 must adjust to allow for additional columns created by buttons 1 and 2)

This way button 1 will create columns for me to insert my expenses and buton 2 will create my payment columns for me.

How can I make this possible



Answer this question

Buttons and Data Sheets

  • BJF

    You say its easy for you to do in excel.

    You talk about a column, a column in a visible control -in which case what control or do you simply want to do this in some data structure.


  • Scott.Anderson

     

    Hi YKgreen,

     

    Welcome to the fora.

    I was wondering if you would entertain some food for thought.

    • Buttons don't really do anything. Code does
    • You aren't looking for buttons to do anything...
      you are looking for functionality that's invoked by buttons.

    Just asking you to consider that....



  • mia_323

    Again please understand that I am completely new to vb programming an a novice to all other programming.

    I should explain that I currently have a data table i my project that I made from an untyped dataset. The current datatable has 6 columns the first 2 columns are string and the next 4 are double. the last double column is read only with the following expression used (column3+column4+column5)/3, this gives me the average of the 3 columns in the last column.

    What I need to do now is create a more complex datatable. I need a instruction and code that will allow me to do the following. I will use excel as a reference since I have done this in excel. I want to start my data table with just 4 columns the first two are for string, then the second 2 are for providing me with totals. Next, I would like to place 2 buttons in my project (simple to do) code to enter columns in between the first and second set of columns. Now here is the tricky part, the total columns need to give me the average of the inserted columns.

    example.

    button a button b

    string string colm a colm b colm a total a total b

    text text 8 8 2 5 8

    So this example I am showing that the total for a columns is 5 (8+2)/2=5 and total b is showing 8 (8+0)/1=8 the divided by number should change according to the number of column types.

    This is what I am trying to get do.

    Thanks



  • lalon

    I agree with spotty, we're attempting to assist you in learning the language to describe and discuss your solution.

    Professionals talk for days without ever using the word "button" once. Please consider that, because what I'm really attempting to impart is that the word button is not a part of the solution. That a UI (User interface). We are attempting to discussion program logic flow.



  • GameCi_kamaci

    Okay

    I would like to create 4 different codes. I would like to create 1 code that would insert a column(A) into my data table. I would also like to create a code that will insert a column(B) into my data table. The next line of code that I need is to ensure that one of my column will constantly add the values of all column(A)s and divide the values insert into any column(A) by the number of column(A)s in the data table, and I am sure you can guess I would like the next code to do the same function for the values inserted into any column(B).

    example.

    button control a button control b

    string string colm a colm b colm a total a total b

    text text 8 8 2 5 8

    So this example I am showing that the total for a columns is 5 (8+2)/2=5 and total b is showing 8 (8+0)/1=8 the divided by number should change according to the number of column types.

    This is what I am trying to get do.

    Thanks



  • Buttons and Data Sheets