Here Is a sample of the table (with creepy sample data)
|Col A |Col B |Col C |Col D |Col E +------------+----------+--------+----------+----- |Number |Value |X |Date |Decimal |1 | AA|X |2012/01/01|.1 |2 | BB|X |2012/02/01|.2 |3 | CC|X |2012/03/01|.3 |4 | DD|X |2012/04/01|.4 |5 | EE|X |2012/05/01|.5
What needs to be done:
- Sort the table according to the “Value”(Col B in this instance) in a macro
Conditions:
- The header values DOES NOT change
- I have to search the headers which will contain the word “Value” since it changes from Col C to Col D or Col A… B… E…
- Column headers ALWAYS stay at 1st row
What I have done so far:
- Brute force the value…(BAD!)
- Search the header to find what column contains the header “Value”
- Get the column letter/number and store in a variable
Problems:
- Using the column letter or number as basis for sort.
(i.e. Range (colLetter & “:” & colLetter))
Any help would be appriciated
1 Answer