VBA Macro for text dates

chintanpatel

New Member
Joined
Apr 15, 2022
Messages
2
Office Version
  1. 2011
Platform
  1. Windows
Hi ,

I need to copy and paste data based on certain conditions are met in tab 2 data. The conditions are will be in tab 1.

I have managed to get data spilt into diffrent tabs.

The most challeging part for me is date section in tab 2 column 3, is in dd/mm/yyyy HH:mm:ss, one of the condition I need to meet is if user enters the date say 10/04/2022 as a start date and end date is 11/04/2022 and I need to copy data from tab 2 from 10/04/2022 12:00:00 midday to 11/04/2022 midday only.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

bebo021999

Well-known Member
Joined
Jul 14, 2011
Messages
1,262
Office Version
  1. 2016
Just use
newDate = InputDate + 1/2
then use newDate as criteria
 

chintanpatel

New Member
Joined
Apr 15, 2022
Messages
2
Office Version
  1. 2011
Platform
  1. Windows
Hi bebo021999,

Thank you very much for this. I should have explained this better in first place. Apologies for this.

I have dates in text format and what I am trying to achieve is once use enters the selection here and it should pick up data based on this

this is user input field in Tab 1, essentially they will be typing something like Start date 01/02/2022 12:00:00
End date 02/02/2022 12:00:00

1650610456901.png

this is user input field in Tab 1, essentially they will be typing something like Start date 01/02/2022 12:00:00
End date 02/02/2022 12:00:00 and based on this it should pick up the data from tab2 below and throw it into respective tab.

1650610365074.png
this is the raw data


Thank you
kind regards,
Chintan
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,256
Messages
5,852,924
Members
431,532
Latest member
Lroy9827

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
Top