Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

743 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

12 Experts available now in Live!

Get 1:1 Help Now