Solved

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

Posted on 2012-03-13
5
160 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 46

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 46

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

636 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