Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Building simple Macro help

Status
Not open for further replies.

FishMaster

Mechanical
Jul 8, 2012
1
I have never written any computer code, if someone could help me with a simple macro. Our eng. department summarizes data from one work sheet to another. What I would like to be able to do is take the test data from one sheet and summarize it to another. The test data doesn’t always come off the same way so I think it would work best if the Macro looked for a word in a row and then located the correct Colum and then collect the data. Please picture below example in an excell grid format

Barometer 29.19 29.19 29.19 29.18 29.18 29.17 29.17 29.18 AVERAGE
Apple 103.9 104. 104. 104. 104.1 103.8 103.9 103.97
Orange 74.04 73.99 73.95 73.97 74.04 74. 74.04 73.99



It needs to find "Apple" then count over however far to the Average column and pull the data and then paste it into the new summary sheet. If someone can get me started I will work on completing it.


Thanks
 
Replies continue below

Recommended for you

I don't think you need a macro. It sounds like you're describing exactly what the VLOOKUP function does in Excel. To that end, here's two ideas for getting started:

1. Paste the following into an Excel spreadsheet cell:
Code:
=VLOOKUP("Apple", A1:J3, 10)
That will grab the value from the AVERAGE column of the Apple row, as long as the data is in A1:J3. To find out how the function works, click the fx button when editing the cell.

2. For more assistance, try the engineering spreadsheets forum (link below). Be warned though, some folk might expect that you've done a little more work on your own behalf before asking for help!

 
Perhaps an un-necessary tip, but if the number of values is not constant between spreadsheets (but the same between each row) you can add CountA to LiteYear's tip

Code:

This will give you the last value in each row, no matter how many columns there are... the caveat is that the average column would need to be in the same column for all data sets.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor