Macro - add a new column cell value based on a column's cell value (time)

Restricted

Board Regular
Joined
Aug 9, 2014
Messages
76
AmountDate & TimeTitleCommentsaddNewCol
20009/10/2017 10:15AC
33319/10/2017 14:20BD
14509/10/2017 14:45EFX
24419/10/2017 16:24GHX

<tbody>
</tbody>

Date & Time column is in this custom format:
Code:
d/mm/yyyy h:mm
  • Data is entered into the cell like so: 9/10/2017 5:00:00 PM
  • and appears like so, as per custom format: 9/10/2017 17:00

There are batches of date/times, each split into 3 hour intervals, each batch separated by a blank row, as shown above,
I need a macro that searches for a particular time range (i.e. 2:40PM - 4:39PM) in the 'Date & Time' column, and if it falls within that range, it adds an 'X' in a new column (the next available empty column I suppose) for that particular row matching the criteria.

It would be ideal to have a pop up that asks for the time range I'm interested in, but I'm happy to edit and run the macro manually to suit the criteria I require.

Any ideas?
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top