dakotacondon1
New Member
- Joined
- Oct 25, 2023
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hi! I have data that looks like this:
(These are not real, I made them up.)
Ultimately, I need these titles to be ordered chronologically and bracketed with a space in the middle in one cell so they can be pasted into a report. The end result should look like this:
I do not understand VBA code. I hope to one day but right now I am just an okay Google-er. Currently, I have it miraculously set up with VBA code I found on the internet so when you paste the data into Column B, it automatically orders it. The problem is that it is ordering it alphabetically so it obviously doesn't work when there are any differences in the beginnings of the titles. I need these to be ordered by the date and then the time (military time, the four numbers after the date) no matter the title. And then they will work with the rudimentary formulas I made to make them formatted correctly.
Right now I have this in a Worksheet - Change situation:
Then Column B adds brackets [=IF(B2<>"", "["&B2&"]", " "] and then Column F puts them all together in one cell and adds spaces [=D2&" "&D3&" "&D4&" "&D5&" "&D6&" "&D7&" "&D8.....etc]
I'm not sure if I am totally making sense to people who actually know how this works. I have attached a screenshot of the sheet before pasting and one after pasting the above values in it.
Please be nice I have no idea what I am doing and THANK YOU
Axon Body 3 Video 2021-11-25 2229 X60A986468J |
Axon Body 3 Video 2021-11-24 2231 X60A656565V |
Axon Fleet 3 Interior Camera Video 2022-02-21 1920 X60A656565V |
Axon Body 3 Video 2021-08-26 2158 X60A656565V |
Axon Fleet 3 Front Camera Video 2021-11-27 2156 X60A986468J |
Axon Body 3 Video 2021-12-01 2154 X60A656565V |
Ultimately, I need these titles to be ordered chronologically and bracketed with a space in the middle in one cell so they can be pasted into a report. The end result should look like this:
[Axon Body 3 Video 2021-08-26 2158 X60A656565V] [Axon Body 3 Video 2021-11-24 2231 X60A656565V] [Axon Body 3 Video 2021-11-25 2229 X60A986468J] [Axon Fleet 3 Front Camera Video 2021-11-27 2156 X60A986468J] [Axon Body 3 Video 2021-12-01 2154 X60A656565V] [Axon Fleet 3 Interior Camera Video 2022-02-21 1920 X60A656565V] |
I do not understand VBA code. I hope to one day but right now I am just an okay Google-er. Currently, I have it miraculously set up with VBA code I found on the internet so when you paste the data into Column B, it automatically orders it. The problem is that it is ordering it alphabetically so it obviously doesn't work when there are any differences in the beginnings of the titles. I need these to be ordered by the date and then the time (military time, the four numbers after the date) no matter the title. And then they will work with the rudimentary formulas I made to make them formatted correctly.
Right now I have this in a Worksheet - Change situation:
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim lastrow As Long
lastrow = Cells(Rows.Count, 2).End(xlUp).Row
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Range("B1:B" & lastrow).Sort key1:=Range("B1:B" & lastrow), _
order1:=xlAscending, Header:=xlYes
End If
End Sub
Then Column B adds brackets [=IF(B2<>"", "["&B2&"]", " "] and then Column F puts them all together in one cell and adds spaces [=D2&" "&D3&" "&D4&" "&D5&" "&D6&" "&D7&" "&D8.....etc]
I'm not sure if I am totally making sense to people who actually know how this works. I have attached a screenshot of the sheet before pasting and one after pasting the above values in it.
Please be nice I have no idea what I am doing and THANK YOU