Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Array is best?

Marie,

You need a table listing the branches, and giving the district for each in a
column to the right. Then a VLOOKUP would give you the district.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Marie" wrote in message
...
I have a huge amount of data that is downloaded daily. I have the data in

a worksheet and need to extract a district from the data. The problem is the
data only has a branch number, so I have to sort the information by branch
number and manually match that branch number with the district then delete
the rows that I do not need. I have 18 districts that I have to match to
over 100 branches. There is also other criteria that macros pick up from
the data based on the district number. If I just had a seperate macro I
could run first and eliminate the branches I don't need it would save me so
much time. The branches are not in numerical sequence either, for instance
one district might have 55, 56, 122, 123, 124, 125 and 137 as their branches
but I have to match it to another sheets data that only has the district
number 122 and so on. I was trying to set up arrays that like the example
below before all the other criteria. I can't get it to work.

If Range(Array(,55,56,122,123,124,125, 137) 'district 122
cell.offset (0,1).value
else Selection.EntireRow.Delete





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Array is best?

Thanks for your suggestion.
That would work if I didn't have all the other select criteria. I need a line before the other selections I make to just keep the rows with the correct branches and delete all the other rows. I hope I am making sense!
I have several sheets. The information I download does not have the necessary district info so to compare it with all the criteria in my other macros I have manually been deleting the rows I don't need. I think there must be a way to add a line - or two- above my select criteria to say if it matches the district number on sheet one, and falls into the array of branch numbers in sheet two 'do nothing' if not delete the row - then I would be able to continue with my other If statements. I have written codes in the past to try to accomplish this but they have always deleted all the information - cleaned the whole page! Maybe I just need to continue to sort and delete manually. I have been reading a lot on this board and with everything that seems to be possible I was hoping there was a way....I have also been reading a vb for applications book but can't find the answer there either.

"Earl Kiosterud" wrote:

Marie,

You need a table listing the branches, and giving the district for each in a
column to the right. Then a VLOOKUP would give you the district.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Marie" wrote in message
...
I have a huge amount of data that is downloaded daily. I have the data in

a worksheet and need to extract a district from the data. The problem is the
data only has a branch number, so I have to sort the information by branch
number and manually match that branch number with the district then delete
the rows that I do not need. I have 18 districts that I have to match to
over 100 branches. There is also other criteria that macros pick up from
the data based on the district number. If I just had a seperate macro I
could run first and eliminate the branches I don't need it would save me so
much time. The branches are not in numerical sequence either, for instance
one district might have 55, 56, 122, 123, 124, 125 and 137 as their branches
but I have to match it to another sheets data that only has the district
number 122 and so on. I was trying to set up arrays that like the example
below before all the other criteria. I can't get it to work.

If Range(Array(,55,56,122,123,124,125, 137) 'district 122
cell.offset (0,1).value
else Selection.EntireRow.Delete






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"