473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want to write code to look through a large sheet and pull in certain data.

3 New Member
I am trying to write a code to look through one column of a large worksheet pulling in data from that sheet in to others. What I have is a column titled "sector" I want the code to loop through this column and seperate the like values. I then want it to pull the data based on each sector in the worksheets I have created for them.

For ex. the sector column includes things like U.S. Treasury, FNMA, and GNMA. I was to use vba to seperate each of these onto their respective worksheet.

Thanks.
Aug 13 '10 #1
4 1250
Kyle Pellum
3 New Member
Just wanted to attach the spreadsheet to give a better idea.
Attached Files
File Type: zip AGG.zip (76.1 KB, 56 views)
Aug 13 '10 #2
Guido Geurs
767 Recognized Expert Contributor
The idea is:
1st - find all the different values for "sector" and put them in an ARRAY.
2nd - find in the rows of data, for each value (sector) of the first array, and put them in a second ARRAY.
Dump the last array in the corresponding sheet.

There are calls in BYTES in which data is sorted into sheets like:
"Form data not going to correct date tab" from vbanewbie2
Aug 15 '10 #3
Guido Geurs
767 Recognized Expert Contributor
I hope this will help You (see attachment)
Run the macro "Filter_Data"
Attached Files
File Type: zip AGG_v1.2.zip (129.5 KB, 54 views)
Aug 15 '10 #4
Guido Geurs
767 Recognized Expert Contributor
I'm sorry but there was an error in the code.
I hope this is the right one: see attachment

PS:
I have also added a "report" sheet with the number of records copied to the sheets.

The Data sheet is modiffied in this workbook because I wanted to do a test with sectors with only 1 row of data.
Excel was giving an error when there was only 1 row data in a collection sheet with several "sectors".
Attached Files
File Type: zip AGG_v1.4.zip (149.2 KB, 64 views)
Aug 15 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

19
2372
by: Caesar | last post by:
Hi, I'm wondering if anyone here can point me in the right direction. My host does not provide php, and so I need to pull this data from another server that does support such scripting. Help?...
27
5624
by: Sune | last post by:
Hi! Pre-requisites: ------------------- 1) Consider I'm about to write a quite large program. Say 500 K lines. 2) Part of this code will consist of 50 structs with, say, no more than at most...
0
1634
by: Richard Marsden | last post by:
I'm having a lot of trouble writing large chunks of binary data (tests are in the range of 16-512K, but we need support for large longblobs) to MySQL using ODBC. Database is local on a W2K system,...
88
7953
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
4
1331
by: juicy | last post by:
Is it possible to pull out data by key in one field value and query out the rest data from the table and show out in the form by just pressing a tab key? Eg, by entering customer ID and press...
1
1083
by: 09shilpa | last post by:
I have an ASP page in which there are many combo box & list , based on its selection the query is written to fetch the data, now i hv a 3d button. on click of that button i have to pull that data &...
8
2299
by: mohammaditraders | last post by:
#include <iostream.h> #include <stdlib.h> #include <conio.h> #include <string.h> class Matrix { private : int numRows, numCols ; int elements ;
4
1351
by: Prodian | last post by:
Im trying to parse a recv from a telnet session then only grab certain data. Heres an example of the recv that Im storing into a string: Internet 204.189.124.205 0 001a.a01f.4e5a ...
1
1319
by: Kyle Pellum | last post by:
I am trying to write code to copy and paste a worksheet from one workbook to another. The thing I cannot figure out is how to reference the workbook to be copied because the name will be different...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.