Writing Macro to Pick Rows from Updating Spreadsheet

TheJackal26

New Member
Joined
Jun 15, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hey all, I've been struggling with this one for the past few days. I wrote a userform that people can use to input data in real time to a spreadsheet. However, I am trying to write a macro (or if there's an elegant function even better) that would allow me to extract all the entries from today's date in real time to a different sheet. I tried the query and filter function but couldn't seem to figure them out.

Does anyone have any suggestions or done anything similar that would jog the imagination? Thanks!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
13,603
Office Version
  1. 2007
Platform
  1. Windows
Hi and welcome to MrExcel

Assuming the following, the data starts in cell A1, the dates are in column 1, the sheet with data is sheet1 and the target sheet is sheet2, then:

VBA Code:
Sub CopyToday()
  With Sheets("Sheet1")
    .Range("A1").AutoFilter 1, xlFilterToday, xlFilterDynamic
    .AutoFilter.Range.EntireRow.Copy Sheets("Sheet2").Range("A1")
    .ShowAllData
  End With
End Sub
 
Solution

Forum statistics

Threads
1,141,416
Messages
5,706,310
Members
421,441
Latest member
VapesRub

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