PC Review


Reply
Thread Tools Rate Thread

Determine the distance between 2 cells in a column

 
 
Ironhydroxide
Guest
Posts: n/a
 
      7th Jan 2009
So my problem is i have a program that searches for (and finds) certain cells
in my worksheet. it then transfers this data (and the data from a couple of
cells around it) to another sheet. Part of the other information is a sub
header i have. (i have a main header, 3 sub headers (2 different types) and
between 3 and 5 rows of information under each sub header) what i want is to
find the nearest sub header above the cell i just found.

i have come to the conclusion that i am in need of a function that can
determine the distance between the two cells, then i take the variable with
the closest negative (or mabye positive) distance and transfer this data into
my sheet.

to make this clearer i will copy a portion of my code
With Selection
Set a = .Find("Elder", , , , xlByColumns)
Set b = a.Offset(0, 3)
Worksheets("PhoneList").Cells(rowvar, 1) = a.Offset(0, 1).Value
Worksheets("PhoneList").Cells(rowvar, 2) = a.Offset(1).Value
Set branch = .Find("Zweig", a, , , xlByColumns, 2)
Set gemeinde = .Find("Gemeinde", a, , , xlByColumns, 2)
***'this is where i run into the problem of finding the closest cell above
the cell i have (note it can either have "Zweig" in it or "Gemeinde" in
it)******

Vielen Dank

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i determine the area under a graph ( distance vrs height) Surfet Microsoft Excel Charting 1 22nd Oct 2009 02:06 PM
How can I determine if a point is a given distance from a secondpoint? Tom P. Microsoft C# .NET 8 1st Apr 2008 03:19 AM
Distance between cells =?Utf-8?B?R2FyeScncyBTdHVkZW50?= Microsoft Excel Misc 6 3rd Dec 2005 03:10 AM
How does Windows Determine a call is long distance? Ernie Cox Microsoft Windows 2000 Fax 0 19th Aug 2005 04:09 PM
Need to determine if a call is Long Distance Paul D Microsoft Excel Worksheet Functions 2 26th May 2004 06:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:46 PM.