Hi everyone. Good day. I just want to ask for help regarding my problem on this one.
This is the output when I run my macro, it's fetching the data from "Precious - Sol - Angel" which is the Notes data based on today's date. I don't have a problem with this.
My problem is when the macro is executed, I need to display the data from oldest to newest based on the month and date of the Notes column Can anyone help me?
This is the code I have right now.
These are the results and my code that I need to sort from lowest to newest. Can someone help me?
This is the output when I run my macro, it's fetching the data from "Precious - Sol - Angel" which is the Notes data based on today's date. I don't have a problem with this.
My problem is when the macro is executed, I need to display the data from oldest to newest based on the month and date of the Notes column Can anyone help me?
This is the code I have right now.
Book11.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Name | ||
2 | 03/05/2023 | Adrian Santos | ||
3 | 03/06/2023 | Adrian Sanchez | ||
4 | 03/06/2023 | Ranch Book | ||
5 | 03/07/2023 | Auto Sum | ||
6 | 03/08/2023 | Fernandez | ||
7 | 03/09/2023 | Tolentino | ||
8 | 03/10/2023 | Loti | ||
9 | 02/04/2023 | 04/01: borrowed 21$ | ||
10 | 03/12/2023 | Duke | ||
Precious |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A9 | A9 | =TODAY() |
Book11.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Name | ||
2 | 03/05/2023 | Adrian Santos 1 | ||
3 | 03/06/2023 | Adrian Sanchez 2 | ||
4 | 03/06/2023 | Ranch Book 3 | ||
5 | 03/07/2023 | Auto Sum 4 | ||
6 | 03/08/2023 | Fernandez 5 | ||
7 | 03/09/2023 | Tolentino 6 | ||
8 | 03/10/2023 | Loti 7 | ||
9 | 02/04/2023 | 04/02: borrowed 25$ | ||
10 | 03/12/2023 | Duke 9 | ||
Sol |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A9 | A9 | =TODAY() |
Book11.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Notes | ||
2 | 03/05/2023 | 03/05: borrowed 11$ | ||
3 | 03/06/2023 | 03/06: borrowed 11$ | ||
4 | 03/06/2023 | 03/06: borrowed 12$ | ||
5 | 03/07/2023 | 03/07: borrowed 13$ | ||
6 | 03/08/2023 | 03/08: borrowed 14$ | ||
7 | 03/09/2023 | 03/09: borrowed 15$ | ||
8 | 03/10/2023 | 03/10: borrowed 16$ | ||
9 | 11-Mar-23 | 03/11: borrowed 17$ | ||
10 | 03/12/2023 | 03/12: borrowed 18$ | ||
11 | 02/04/2023 | 03/29: borrowed 19$ | ||
Angel |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A11 | A11 | =TODAY() |
These are the results and my code that I need to sort from lowest to newest. Can someone help me?
VBA Code:
Private Sub UserForm_Initialize()
Dim firstSheet As String
Dim secondSheet As String
Dim thirdSheet As String
Dim Result As String
firstSheet = Worksheets("Precious").Range("D2").Value
secondSheet = Worksheets("Sol").Range("D2").Value
thirdSheet = Worksheets("Angel").Range("D2").Value
Results = firstSheet & vbCrLf & secondSheet & vbCrLf & thirdSheet
Me.TextBox1.Value = Results
TextBox1.MultiLine = True