Copy TODAY data

chris89

New Member
Joined
Feb 4, 2005
Messages
31
Hi,

I have a worksheet (A) which compile all the data of the year. However, i need to run a macro which will copy only TODAY data from worksheet (A) to worksheet (B). Again, i need the table appears shade with alternate 2 rows.

Thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi Chris,
(please stick to one thread per subject.)

That said, if your dates were in column A of sheetA, then maybe something like this?...
Code:
Sub TestSub()
Dim i As Range
Set i = Range("A1", Range("A65536").End(xlUp))
For Each cell In i
    If cell.Value = Date Then cell.Rows.EntireRow.Copy Sheets("B").[A65536].End(xlUp)(2, 1)
Next cell

Sheets("B").Select
Set i = Range("A1", Range("A65536").End(xlUp))
With i.Rows.EntireRow
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=0"
    .FormatConditions(1).Interior.ColorIndex = 15
End With

End Sub
Hope it helps,
Dan
 
Upvote 0

Forum statistics

Threads
1,203,242
Messages
6,054,345
Members
444,717
Latest member
melindanegron

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