PDA

View Full Version : Moving Data from one table to another based on value input



Enginerd
05-26-2009, 09:11 AM
hello, I am trying to move data from one table to another based on user input. I have a cell marked Height where the user can enter any height they please and this table (there is alot more data in the actual table this is for berevities sake)

Height VAL1 VAL 2
0-15 .21 .23
20 .33 -.35
30 .45 .6
40 .75 .89

What i want to do is based on the user input I.E 36 Ft to have another table populate with the values up to the nearest lesser value ie the new table would look like this

Height VAL1 VAL 2
0-15 .21 .23
20 .33 -.35
30 .45 .6

Im not entirly sure how to code this into Visual Basic I am Using Excel 2007 with visual basic 6.5, ive done this with a crap load of if then statements already but i know smarter people then myself know a much better way to accomplish this... Any help would be greatly appreciated.

Aussiebear
05-26-2009, 04:43 PM
Hi Enginerd, Welcome to VBA Express forum. To assist you here, it would be necessary to see more detail than is currently available. Would you mind posting a workbook with a much detail as you can provide. Questions that come to mind as it currently stands are:

Are the tables on the same or different sheets, same or different workbooks? Where does the lessor values come from? What format are the tables? What is the cell location of the input value?

When posting a workbook, go to Go Advanced, then Manage Attachments, upload your workbook, then post the reply.