Try this code:
Option Explicit
Sub tom()
Dim lc As Long
lc = Cells(12, Columns.Count).End(xlToLeft).Column
Dim i As Long
For i = 3 To lc
If Cells(12, i) = Date Then
Range(Cells(13, i), Cells(21, i)).Copy
Range(Cells(13, i), Cells(21, i)).PasteSpecial xlPasteValues
End If
Next i
Application.CutCopyMode = False
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
Bookmarks