VBA extract

lrd300

New Member
Joined
Mar 8, 2016
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am using the below to extract data and it is working. I would like to modify slightly to get data between a certain date a time instead of the range.

Workbooks("SOURCE").Worksheets("Sheet1").Range("D:D").Copy Destination:=Workbooks("DESTINATION").Worksheets("sheet1").Range("IN:IN")

I need to extract the Value in column B when the time in column A is 00:00:00 (22/07/2023) and 23:00:00 (22/07/2023)


A B
TimeValue
18:00:00 (21/07/2023)
9033883.647​
19:00:00 (21/07/2023)
9033883.647​
20:00:00 (21/07/2023)
9033883.647​
21:00:00 (21/07/2023)
9033883.647​
22:00:00 (21/07/2023)
9033883.647​
23:00:00 (21/07/2023)
9033883.647​
00:00:00 (22/07/2023)
9033883.647​
01:00:00 (22/07/2023)
9033883.647​
02:00:00 (22/07/2023)
9033883.647​
03:00:00 (22/07/2023)
9033883.647​
04:00:00 (22/07/2023)
9033883.647​
05:00:00 (22/07/2023)
9033883.647​
06:00:00 (22/07/2023)
9033883.647​
07:00:00 (22/07/2023)
9033883.647​
08:00:00 (22/07/2023)
9033883.647​
09:00:00 (22/07/2023)
9033883.647​
10:00:00 (22/07/2023)
9033883.647​
11:00:00 (22/07/2023)
9033883.647​
12:00:00 (22/07/2023)
9033883.647​
13:00:00 (22/07/2023)
9033883.647​
14:00:00 (22/07/2023)
9033883.647​
15:00:00 (22/07/2023)
9033883.647​
16:00:00 (22/07/2023)
9033883.648​
17:00:00 (22/07/2023)
9033883.648​
18:00:00 (22/07/2023)
9033883.648​
19:00:00 (22/07/2023)
9033883.648​
20:00:00 (22/07/2023)
9033883.648​
21:00:00 (22/07/2023)
9033883.648​
22:00:00 (22/07/2023)
9033883.648​
23:00:00 (22/07/2023)
9033883.648​
00:00:00 (23/07/2023)
9033883.648​
01:00:00 (23/07/2023)
9033883.648​
02:00:00 (23/07/2023)
9033883.648​
03:00:00 (23/07/2023)
9033883.648​
04:00:00 (23/07/2023)
9033883.648​
05:00:00 (23/07/2023)
9033883.648​
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using, as the best solution often varies by version. Don’t forget to scroll down to save your changes.

Also, please provide some sample data and expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data, allowing us to copy/paste it to our Excel spreadsheets to work with the same data you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that this board also has a "Test Here” forum. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Thanks,

Doug
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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