Here is some untested VBA code that should help
Option Explicit
Sub TodayTrans()
Dim lr As Long, i As Long
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
lr = s1.Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
lr2 = s2.Range("A" & Rows.Count).End(xlUp).Row
s2.Range("A2:C" & lr2).ClearContents
With s1
For i = 2 To lr
lr2 = s2.Range("A" & Rows.Count).End(xlUp).Row
If .Range("A" & i).Value = Date Then
.Range("A" & i & ":C" & i).Copy s2.Range("A" & lr2 + 1)
End If
Next i
End With
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox ("Ready to email")
End Sub
How to install your new code
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
To run the Excel VBA code:- Press Alt-F8 to open the macro list
- Select a macro in the list
- Click the Run button
EDIT: I think that John's solution will run faster.
Bookmarks