H
Henning Hagen
I have pulled out all my hair, so I hope someome can help me...
I have an aircraft reliability report in Excel, in which data have been
manually input until now. The format of the worksheets and graphs works well,
so I don't want to change it. The data sheets in this file have the last 24
months in column B to Y (date format like aug.06). The actual months will be
updated every time the report is issued. The data sheets also have something
called ATA codes. These are located in A9 to A42 (text format with values
like 21, 22, 32,56) This range and the values never change. To illustrate, it
looks like this:
Sheet920011
|A |B |C |
5 | |Okt.04 |Nov.04 |
9 |21 | | |
10|22 | | |
12|24 | | |
There are lots of other columns/fields for flying hours and calculations,
but that is not important for what I need. There is one matrix (sheet) like
above for each serialnumber aircraft.
I now run a query in an Oracle application to get the data which will go into
the matrix above. This query gives me aircraft serialnumber, month (as in
row 5
above), ATA code (as in column A above), and number of occurances per
aircraft.
Structure is occurances per ATA code per month per serialnumber . Note that
the number of records will vary if there are no occurances of a particular
ATA code. When I have imported the data to a sheet in the Excel file, sorted
by A, B, C, it
looks like this:
Inputsheet
|A |B |C |D |
1|920011|Okt.04 |21 |5 |
2|920011|Okt.04 |24 |2 |
3|920011|Nov.04 |22 |4 |
I have tried all kinds of different ways to put the right data in the right
place, without success.
What I need is some VBA code which loops through the inputsheet, finds the
data
based on criteria from sheet920011 A9:A42 (fixed values) and B5:Y5 (variable
values), and copies it into the corresponding cell in sheet920011. With the
correct code, looking at the example above, Inputsheet D1 should go to
Sheet920011 B9, D2 to B12, and D3 to C10.
I really hope some of you with guru status can help me here.
I have an aircraft reliability report in Excel, in which data have been
manually input until now. The format of the worksheets and graphs works well,
so I don't want to change it. The data sheets in this file have the last 24
months in column B to Y (date format like aug.06). The actual months will be
updated every time the report is issued. The data sheets also have something
called ATA codes. These are located in A9 to A42 (text format with values
like 21, 22, 32,56) This range and the values never change. To illustrate, it
looks like this:
Sheet920011
|A |B |C |
5 | |Okt.04 |Nov.04 |
9 |21 | | |
10|22 | | |
12|24 | | |
There are lots of other columns/fields for flying hours and calculations,
but that is not important for what I need. There is one matrix (sheet) like
above for each serialnumber aircraft.
I now run a query in an Oracle application to get the data which will go into
the matrix above. This query gives me aircraft serialnumber, month (as in
row 5
above), ATA code (as in column A above), and number of occurances per
aircraft.
Structure is occurances per ATA code per month per serialnumber . Note that
the number of records will vary if there are no occurances of a particular
ATA code. When I have imported the data to a sheet in the Excel file, sorted
by A, B, C, it
looks like this:
Inputsheet
|A |B |C |D |
1|920011|Okt.04 |21 |5 |
2|920011|Okt.04 |24 |2 |
3|920011|Nov.04 |22 |4 |
I have tried all kinds of different ways to put the right data in the right
place, without success.
What I need is some VBA code which loops through the inputsheet, finds the
data
based on criteria from sheet920011 A9:A42 (fixed values) and B5:Y5 (variable
values), and copies it into the corresponding cell in sheet920011. With the
correct code, looking at the example above, Inputsheet D1 should go to
Sheet920011 B9, D2 to B12, and D3 to C10.
I really hope some of you with guru status can help me here.