B
BEEJAY
Help.
Working in Excel 2003, SP2.
Am drawing a total blank as to how to accomplish the following:
The end result is required to identify production Job Numbers in another
report.
The steps required, as I see it, are entered below the sample data.
(I hope the columns show properly)
A B C
D
HP-BOGIE-AIR-INSTALL 011F7-0016
HP-BOGIE-AIR-INSTALL 011F7-0016 011F7-0018
1 HP-STAGE-200 011F7-0017
HP-STAGE-200 011F7-0017
HP-STAGE-200 011F7-0017
HP-STAGE-200 011F7-0017 011F7-0019
HP-STAGE-200 011F7-0017 011F7-0020
HP-STAGE-200 011F7-0017 011F7-0021
HP-STAGE-200 011F7-0017 011F7-0022
HP-STAGE-200 011F7-0017 011F7-0023
HP-STAGE-200 011F7-0017 011F7-0024
HP-STAGE-200 011F7-0017 011F7-0025
HP-STAGE-200 011F7-0017 011F7-0026
HP-STAGE-200 011F7-0017 011F7-0027
HP-STAGE-200 011F7-0017 011F7-0028
HP-STAGE-200 011F7-0017 011F7-0029
HP-STAGE-200 011F7-0017 011F7-0030
HP-BOGIE-PAINT 011F7-0018 011F7-0031
HP-BOGIE-PAINT 011F7-0018 011F7-0032
HP-ROOF-ASSY 011F7-0019
HP-ROOF-ASSY 011F7-0019
Manually Select Stage (Column A, Row ?) to Start At
Enter a '1' in Column A, at the required row (See Above)
Option Explicit
Sub JobNumberSelect()
1st Procedure
Dim r As Range, lastrow As Long
Set r = ActiveSheetUsedRange
lastrow = r.Row + r.Rows.Count - 1
2nd Procedure
Find 1st row in Column 'A', with a '1' in it.
Read cell 'C', in same row
Check next row for matching number
If Found, put '1' in Column 'A' of that row
If NOT Found check Next Row
Check ALL rows to End (bottom) and mark with '1', if required
3rd Procedure
Start at A1
Find first cell with a '1' in it (Call it START)
"Check cell D. If a number in cell D, find occurance(s) of that number
in column C and identify those row(s) with a '1' in column 'A'"
Go to START +1
"Check cell D. If a number in cell D, find occurance(s) of that number
in column C and identify those row(s) with a '1' in column 'A'"
Go to START +2
"Check cell D. If a number in cell D, find occurance(s) of that number
in column C and identify those row(s) with a '1' in column 'A'"
Loop until last row
4th Procedure
Insert WorkSheet at End
"From sheet 1:
All those rows that have a '1' in Column 'A',
Copy the number from Column 'C' to sheet 2 (vertically)"
"Eliminate any duplicate numbers
(delete those rows, so no blank rows are created)"
END SUB
Working in Excel 2003, SP2.
Am drawing a total blank as to how to accomplish the following:
The end result is required to identify production Job Numbers in another
report.
The steps required, as I see it, are entered below the sample data.
(I hope the columns show properly)
A B C
D
HP-BOGIE-AIR-INSTALL 011F7-0016
HP-BOGIE-AIR-INSTALL 011F7-0016 011F7-0018
1 HP-STAGE-200 011F7-0017
HP-STAGE-200 011F7-0017
HP-STAGE-200 011F7-0017
HP-STAGE-200 011F7-0017 011F7-0019
HP-STAGE-200 011F7-0017 011F7-0020
HP-STAGE-200 011F7-0017 011F7-0021
HP-STAGE-200 011F7-0017 011F7-0022
HP-STAGE-200 011F7-0017 011F7-0023
HP-STAGE-200 011F7-0017 011F7-0024
HP-STAGE-200 011F7-0017 011F7-0025
HP-STAGE-200 011F7-0017 011F7-0026
HP-STAGE-200 011F7-0017 011F7-0027
HP-STAGE-200 011F7-0017 011F7-0028
HP-STAGE-200 011F7-0017 011F7-0029
HP-STAGE-200 011F7-0017 011F7-0030
HP-BOGIE-PAINT 011F7-0018 011F7-0031
HP-BOGIE-PAINT 011F7-0018 011F7-0032
HP-ROOF-ASSY 011F7-0019
HP-ROOF-ASSY 011F7-0019
Manually Select Stage (Column A, Row ?) to Start At
Enter a '1' in Column A, at the required row (See Above)
Option Explicit
Sub JobNumberSelect()
1st Procedure
Dim r As Range, lastrow As Long
Set r = ActiveSheetUsedRange
lastrow = r.Row + r.Rows.Count - 1
2nd Procedure
Find 1st row in Column 'A', with a '1' in it.
Read cell 'C', in same row
Check next row for matching number
If Found, put '1' in Column 'A' of that row
If NOT Found check Next Row
Check ALL rows to End (bottom) and mark with '1', if required
3rd Procedure
Start at A1
Find first cell with a '1' in it (Call it START)
"Check cell D. If a number in cell D, find occurance(s) of that number
in column C and identify those row(s) with a '1' in column 'A'"
Go to START +1
"Check cell D. If a number in cell D, find occurance(s) of that number
in column C and identify those row(s) with a '1' in column 'A'"
Go to START +2
"Check cell D. If a number in cell D, find occurance(s) of that number
in column C and identify those row(s) with a '1' in column 'A'"
Loop until last row
4th Procedure
Insert WorkSheet at End
"From sheet 1:
All those rows that have a '1' in Column 'A',
Copy the number from Column 'C' to sheet 2 (vertically)"
"Eliminate any duplicate numbers
(delete those rows, so no blank rows are created)"
END SUB