Hi,
I am trying to sort/copy/paste a set of data into multiple locations. As far as sorting and splitting basic data sets, I am comfortable. However, I need to split this based upon several criteria and whilst I can understand how to do it logically, I am struggling to turn this into VBA.
The data (small example shown below) must be separated as per the following criteria;
Temperature (<=95 / 96<Temp<=130 / 131<Temp<160) subdivided by Pressure (<100 / 101<Pressure<300 / >301).
In my head I am thinking that this means for each row:
Lookup column 3
if <=95 then
Lookup column 4
if <=100 then
select all columns from that row. copy
paste to location A
if 101<pressure<300 then
select all columns from that row. copy
paste to location B
etc.
This seems like it will result in an absolutely huge pile of if/for loops. There is surely a neater way to tackle this problem. Can anyone help out?
I am trying to sort/copy/paste a set of data into multiple locations. As far as sorting and splitting basic data sets, I am comfortable. However, I need to split this based upon several criteria and whilst I can understand how to do it logically, I am struggling to turn this into VBA.
The data (small example shown below) must be separated as per the following criteria;
Temperature (<=95 / 96<Temp<=130 / 131<Temp<160) subdivided by Pressure (<100 / 101<Pressure<300 / >301).
In my head I am thinking that this means for each row:
Lookup column 3
if <=95 then
Lookup column 4
if <=100 then
select all columns from that row. copy
paste to location A
if 101<pressure<300 then
select all columns from that row. copy
paste to location B
etc.
This seems like it will result in an absolutely huge pile of if/for loops. There is surely a neater way to tackle this problem. Can anyone help out?
Region | Development | Temperature (°C) | Pressure (bar) |
USA | Project 1 | 120 | 350 |
USA | Project 2 | 130 | 310 |
UK | Project 3 | 130 | 310 |
ASIA | Project 4 | 135 | |
ASIA | Project 4 | 140 | 115 |
AFRICA | Project 5 | 85 | 550 |
AFRICA | Project 5 | 90 | 100 |