I need help

  • Thread starter Thread starter robert dydo
  • Start date Start date
R

robert dydo

Please imagine this is a data
ID DATA
BHEILMA 100 100 100.00%
ALORD 87.00%
ASMITH 75.00%
BOCHITW 65.90%
AATKINS 92.10%
CCOGHIL 102.20%
CESPINA 100.10%
CFELTON 105.20%
CLEBLAN 88.20%
CMARSMA 78.60%
DCOWAN 69.60%
DCOYLE 88.40%
DFROSST 66.90%
DMACDON 96.30%
DMOORE 77.40%
DROSSI 69.50%
DSMITH 80.30%
ETONNER 83.10%
GGAUVIN 99.10%
GHECKAD 101.10%

I need to create macro which would pick only under 95% results and copy
with it coresponding id to a new
sheet. I must add that % is a result of formula, not just a value. I have no
idea where to start.
thanks
Robert
 
select your data (the cell with ID) and do Data=>Filter=>Autofilter.

Select the second column dropdown and select custom. select less than and
type in 95%

now select you data and copy it to another location. Only the visible rows
will be copied.

If you insist on a macro, turn on the macro recorder while you do the above
manually. That will give you the basic code you need.
 
thank you
Tom Ogilvy said:
select your data (the cell with ID) and do Data=>Filter=>Autofilter.

Select the second column dropdown and select custom. select less than and
type in 95%

now select you data and copy it to another location. Only the visible rows
will be copied.

If you insist on a macro, turn on the macro recorder while you do the above
manually. That will give you the basic code you need.

--
Regards,
Tom Ogilvy


have
 
I tired this but database is not consistent and contains blank cells within
itself, thus not returning results.
 
Thank you for your help. It does work but only with one set of data. I
should have tried to be more descriptive:
There is one ID column, say "A", however there are four columns with "%
"data within the same sheet(columns:Q, AD, AQ,BD). Each "%" corresponds
with the ID horizontally, however cells maybe empty as no data was generated
for some of the ids. I need to fill 4 individual sheets
which will illustrate ID and respective %, as long as it is under 95%. I
can use auto filter only for the first sheet. However if I select the entire
data up to second column it shows two"%" columns along other data(actual
data to calculate %), which defeats the idea of this report format. I
appreciate any ideas. I am obviously at the beginning of the journey with
VBA and it has been a rocky road for me so far.
Thank you very much for the help.
Robert
 
you can filter on the appropriate column, copy the data, delete the columns
you don't want.

Or, you can select just the columns you want and do the copy

so filter on Q,
Select A and Q and do the copy
filter on AD
select A and AD and do the copy
filter on AQ
select A and AQ and do the copy
filter on BD
select A and BD and do the copy

Do it with the macro recorder on and then adjust the code to be more
general.
 
Just to add, the Advanced Filter does have an option to copy to another
location and if you put the selected headers at that location, it will only
copy those columns. You would have to adjust the criteria between each
copy.

Again, the macro recorder will give you a start on the code.
 
Back
Top