Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy/paste VBA
I am trying to write code that will search a sheet and
select all of the rows that contain a certain date. Then I want to copy/paste all of the rows onto a different sheet. I am having some trouble with this, please help! Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy/paste VBA
try something like where b2 has the date desired
for each c in selection if c=range("b2") then c.copy sheets("sheet2").range("a"&range("a65536").end(xlu p).row) next c "matt" wrote in message ... I am trying to write code that will search a sheet and select all of the rows that contain a certain date. Then I want to copy/paste all of the rows onto a different sheet. I am having some trouble with this, please help! Matt |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy/paste VBA
Dim xC As Range, xDate As Date, xRows As String
xDate = "22 August 2003" For Each xC In ActiveSheet.Range("date") If xC.Value = xDate Then xRows = xRows & "," & xC.Row & ":" & xC.Row Next If Len(xRows) Then xRows = Mid$(xRows, 2) ActiveSheet.Range(xRows).Copy Destination:=Worksheets("Sheet2").Range("A1") End If "matt" wrote in message ... I am trying to write code that will search a sheet and select all of the rows that contain a certain date. Then I want to copy/paste all of the rows onto a different sheet. I am having some trouble with this, please help! Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Copy, paste without file name referenced after paste | Excel Discussion (Misc queries) | |||
Copy; Paste; Paste Special are disabled | Excel Discussion (Misc queries) | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) |