Solved

Excel VBA, locate data with sub tables, repeated rows/column headings

Posted on 2012-03-13
5
159 Views
Last Modified: 2012-04-04
I have the following tables in a report:

Adam
                         Address          Phone            
Home
Work

Barry
                         Address          Phone            
Home
Work

Charles
                         Address          Phone            
Home
Work

What is the best way to cherry pick the data I need to store in a variable in VBA?
For example, Barry's Work Phone or Charles' Home Address

Also, these are in the middle of the spreadsheet, they don't start on A1, so need something purely driven by table name (Adam), and row / column name (Work,Phone).

Thanks
0
Comment
Question by:newparadigmz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 37718319
please elaborate on "cherry pick"
0
 

Author Comment

by:newparadigmz
ID: 37718353
For example, Barry's Work Phone or Charles' Home Address

i just mean individual pieces of data
0
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 150 total points
ID: 37719486
You still aren't clear.  A two short-sentence reply isn't an elaboration.

Here is a vague notion of what I was expecting:
* Post an example of your workbook.
* Post some VBA code.
* Explain where, in the code, you need to access some data and a different/better description of the problem you face.

===========
I suspect that your problem exists because your data isn't laid out in a standard format.  I don't know where the data came from and your options to retrieve the data directly from the source, rather than access it in its report format.
0
 

Accepted Solution

by:
newparadigmz earned 0 total points
ID: 37788036
I solved this myself doing the following;

findBarry = find(what:"Barry")
findWork=find(What:"Work", After:findBarry)
findPhone=find(What:"Phone", After:findBarry)
foundBarryWorkPhone=cell(findWork.Row, findPhone.Column)
0
 

Author Closing Comment

by:newparadigmz
ID: 37805147
thanks, though
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question