Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data in a table

Status
Not open for further replies.

newmind

Mechanical
Dec 1, 2008
16
I need a visual basic code to pick up the data in a table. Please help!
 
Replies continue below

Recommended for you

Use the macro recorder on some manual operations, as a start.

TTFN

FAQ731-376
 
Does it have to be VBA? Using the ranges in your sample file the formula below will give what I think you want:

=INDEX($C$17:$Q$24,MATCH(H9,$B$17:$B$24,0),MATCH($B$9,$C$16:$Q$16))

If you do want to get the table data into a VBA array then give the table range a range name (say pipe_data) and create a VBA variable of variant type (that could be pipe_data as well) then:

Dim Pipe_Data as variant

Pipe_Data = range("pipe_data").value2


Will get all the data from your table into the VBA array.

Doug Jenkins
Interactive Design Services
 
This doesn't find the next larger size for intermediate pressures, speeds, and capacities, but it should give you something to work with. Look at the values and formulas below the table. Note that I've named some cells to make the formulas easier to understand.
 
 http://files.engineering.com/getfile.aspx?folder=36b9fa19-9b26-4ff8-b9a6-83e15535d5bd&file=sample(1).xls
Status
Not open for further replies.

Part and Inventory Search

Sponsor