ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Picky/Choosy (https://www.excelbanter.com/excel-programming/287062-picky-choosy.html)

Lexette_jan

Picky/Choosy
 
Can someone assist me, please?
I am looking for a macro that searches down column A for
one of the following criteria cuts and copies the criteria
to column D and puts -1 to -5 in its place.

CRITERIA REPLACED WITH

AQC STANDARD -1
AQC DUPLICATE -2
AQC SPIKE -3
AQC DIFFERENCE -4
LOG DIFFERENCE -5

None of the other information in column A must be copied
to column D only rows that fit the criteria.

Thank you

Jan


Tina

Picky/Choosy
 
Jan
Try
For Each cell In Range("a:a")
If cell = "aqc standard" Then
cell.Offset(0, 3) = cell.value
cell.value = -1
Elseif cell = "aqc duplicate" then
cell.Offset(0, 3) = cell.value
cell.value = -2
End If
Next cell
repeat elseif for other criteria before end if


----- Lexette_jan wrote: -----

Can someone assist me, please?
I am looking for a macro that searches down column A for
one of the following criteria cuts and copies the criteria
to column D and puts -1 to -5 in its place.

CRITERIA REPLACED WITH

AQC STANDARD -1
AQC DUPLICATE -2
AQC SPIKE -3
AQC DIFFERENCE -4
LOG DIFFERENCE -5

None of the other information in column A must be copied
to column D only rows that fit the criteria.

Thank you

Jan



No Name

Picky/Choosy
 
Sorry my mistake I did not explain it well. The -1 to -5
is to show in column A in place of criteria. The criteria
(AQC STANDARD ect) has to show in column D.

Thanks
Jan
-----Original Message-----
Jan
Try
For Each cell In Range("a:a")
If cell = "aqc standard" Then
cell.Offset(0, 3) = cell.value
cell.value = -1
Elseif cell = "aqc duplicate" then
cell.Offset(0, 3) = cell.value
cell.value = -2
End If
Next cell
repeat elseif for other criteria before end if


----- Lexette_jan wrote: -----

Can someone assist me, please?
I am looking for a macro that searches down column A

for
one of the following criteria cuts and copies the

criteria
to column D and puts -1 to -5 in its place.

CRITERIA REPLACED WITH

AQC STANDARD -1
AQC DUPLICATE -2
AQC SPIKE -3
AQC DIFFERENCE -4
LOG DIFFERENCE -5

None of the other information in column A must be

copied
to column D only rows that fit the criteria.

Thank you

Jan


.


Tina

Picky/Choosy
 

I think this code should do this as cell is value in column A macro will select each cell in column A if matches criteria it enters criterial in column D then replaces criteria with -1 etc in column A then moves to next cell and repeats
if this does not work i'm sorry i'm new to trying to hel

----- wrote: ----

Sorry my mistake I did not explain it well. The -1 to -5
is to show in column A in place of criteria. The criteria
(AQC STANDARD ect) has to show in column D

Thanks
Jan
-----Original Message----
Ja
Tr
For Each cell In Range("a:a"
If cell = "aqc standard" The
cell.Offset(0, 3) = cell.valu
cell.value = -
Elseif cell = "aqc duplicate" the
cell.Offset(0, 3) = cell.valu
cell.value = -
End I
Next cel
repeat elseif for other criteria before end i
----- Lexette_jan wrote: ----

Can someone assist me, please?

I am looking for a macro that searches down column A

for
one of the following criteria cuts and copies the

criteria
to column D and puts -1 to -5 in its place.
CRITERIA REPLACED WIT
AQC STANDARD -

AQC DUPLICATE -
AQC SPIKE -3
AQC DIFFERENCE -
LOG DIFFERENCE -
None of the other information in column A must be

copied
to column D only rows that fit the criteria
Thank you
Ja




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com