Solved

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

Posted on 2012-03-13
5
155 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now