XCitableBill
New Member
- Joined
- Apr 13, 2020
- Messages
- 11
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hello Forum.
I have a workbook of 5 individual sheets. Each sheet has the same data headings, but the values within the cells of each sheet may be different. Here's a rough example:
Each series of data (ItemNo, Price, Qty) is from a different worksheet. I want to sort the data by ItemNo in Ascending Order so that the data above would look like the following:
I was able to get the first two columns to sort correctly, but I have 5 series of data points. I run into trouble when the lowest ItemNo in the row is in columns 3 -5. I've come to the apex of my vba knowledge. I don't know how to compare the five ItemNo values to figure out which ones are the lowest value for that row, then insert blank cells in the other rows that have a larger value until that value is the lowest value in the row and so on and so forth. I'm thinking there's got to be a better way than calling a number of if..then...else or For statements or With statements.
Thanks in advance.
Bill
I have a workbook of 5 individual sheets. Each sheet has the same data headings, but the values within the cells of each sheet may be different. Here's a rough example:
ItemNo | Price | ItemNo | Price | ItemNo | Price | ItemNo | Price | ItemNo | Price |
1 | 19.99 | 1 | 19.99 | 1 | 19.99 | 1 | 19.99 | 7 | 4.00 |
2 | 7.00 | 2 | 7.00 | 4 | 4.00 | 2 | 7.00 | 11 | 6.00 |
4 | 4.00 | 6 | 8.00 | 10 | 6.00 | 7 | 50.00 | 25 | 10.00 |
12 | 110.00 | 9 | 9.00 | 11 | 11.00 | 13 | 10.00 | 44 | 10.00 |
Each series of data (ItemNo, Price, Qty) is from a different worksheet. I want to sort the data by ItemNo in Ascending Order so that the data above would look like the following:
ItemNo | Price | ItemNo | Price | ItemNo | Price | ItemNo | Price | ItemNo | Price |
1 | 19.99 | 1 | 19.99 | 1 | 19.95 | 1 | 19.99 | ||
2 | 7.00 | 2 | 7.00 | 2 | 7.00 | ||||
4 | 4.00 | 4 | 4.00 | ||||||
6 | 8.00 | ||||||||
7 | 4.00 | 7 | 4.00 | ||||||
9 | 9.00 | ||||||||
10 | 6.00 | ||||||||
11 | 11.00 | 11 | 11.00 | ||||||
12 | 110.00 | ||||||||
13 | 10.00 | ||||||||
25 | 10.00 |
I was able to get the first two columns to sort correctly, but I have 5 series of data points. I run into trouble when the lowest ItemNo in the row is in columns 3 -5. I've come to the apex of my vba knowledge. I don't know how to compare the five ItemNo values to figure out which ones are the lowest value for that row, then insert blank cells in the other rows that have a larger value until that value is the lowest value in the row and so on and so forth. I'm thinking there's got to be a better way than calling a number of if..then...else or For statements or With statements.
Thanks in advance.
Bill