Hi, Can someone help me with this problem? I need to display the oldest to newest data on the textbox based on the month and date in the Notes column.
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
Book11.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Notes | ||
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 | ||
11 | ||||
Precious |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A9 | A9 | =TODAY() |
Book11.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Notes | ||
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 | ||
11 | ||||
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() |