Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy, paste without file name referenced after paste AusTexRich Excel Discussion (Misc queries) 6 September 23rd 08 02:57 AM
Copy; Paste; Paste Special are disabled Mack Neff[_3_] Excel Discussion (Misc queries) 0 April 28th 08 06:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 08:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"