PC Review


Reply
Thread Tools Rate Thread

copy/paste special

 
 
Rpettis31
Guest
Posts: n/a
 
      11th Mar 2008
I need help to perform this task.

For dt=2 to 1000
If cells(dt,1)=date then Copy paste special this row.
Next dt

 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      11th Mar 2008
If I understand your question correctly, this should do what you want...

Dim dt As Long
Dim LastRow As Long
For dt = 2 To 1000
If Cells(dt, 1) = Date Then
With Worksheets("SomeOtherSheet")
LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
Cells(dt, 1).EntireRow.Copy .Cells(LastRow, 1).Offset(1, 0)
End With
End If
Next dt

You didn't supply a lot of information, so I set it up to run from the
active sheet and place the copied data to SomeOtherSheet.

Rick


"Rpettis31" <(E-Mail Removed)> wrote in message
news:38C2843A-425C-43CD-AA2A-(E-Mail Removed)...
>I need help to perform this task.
>
> For dt=2 to 1000
> If cells(dt,1)=date then Copy paste special this row.
> Next dt
>


 
Reply With Quote
 
Rpettis31
Guest
Posts: n/a
 
      11th Mar 2008
I have data that is prefilled from other sheets to this master sheet.
The dates are prefilled and a Vlookup applies the data in the appropriate
cell without VB. I just want to copy and paste special the values in the
sheet for the current date.

DATE Positions
03/12/08 500 <--- want to automate the copy paste special rather
than the manual process.


"Rick Rothstein (MVP - VB)" wrote:

> If I understand your question correctly, this should do what you want...
>
> Dim dt As Long
> Dim LastRow As Long
> For dt = 2 To 1000
> If Cells(dt, 1) = Date Then
> With Worksheets("SomeOtherSheet")
> LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
> Cells(dt, 1).EntireRow.Copy .Cells(LastRow, 1).Offset(1, 0)
> End With
> End If
> Next dt
>
> You didn't supply a lot of information, so I set it up to run from the
> active sheet and place the copied data to SomeOtherSheet.
>
> Rick
>
>
> "Rpettis31" <(E-Mail Removed)> wrote in message
> news:38C2843A-425C-43CD-AA2A-(E-Mail Removed)...
> >I need help to perform this task.
> >
> > For dt=2 to 1000
> > If cells(dt,1)=date then Copy paste special this row.
> > Next dt
> >

>
>

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      12th Mar 2008
Unless I am missing something, that is what the code I posted does (you
would run the code from your master sheet and specify whatever the name of
the sheet you are copying the information to in the With statement.

Rick


"Rpettis31" <(E-Mail Removed)> wrote in message
news:9D5C88B1-1ABB-4BDB-B56B-(E-Mail Removed)...
>I have data that is prefilled from other sheets to this master sheet.
> The dates are prefilled and a Vlookup applies the data in the appropriate
> cell without VB. I just want to copy and paste special the values in the
> sheet for the current date.
>
> DATE Positions
> 03/12/08 500 <--- want to automate the copy paste special
> rather
> than the manual process.
>
>
> "Rick Rothstein (MVP - VB)" wrote:
>
>> If I understand your question correctly, this should do what you want...
>>
>> Dim dt As Long
>> Dim LastRow As Long
>> For dt = 2 To 1000
>> If Cells(dt, 1) = Date Then
>> With Worksheets("SomeOtherSheet")
>> LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
>> Cells(dt, 1).EntireRow.Copy .Cells(LastRow, 1).Offset(1, 0)
>> End With
>> End If
>> Next dt
>>
>> You didn't supply a lot of information, so I set it up to run from the
>> active sheet and place the copied data to SomeOtherSheet.
>>
>> Rick
>>
>>
>> "Rpettis31" <(E-Mail Removed)> wrote in message
>> news:38C2843A-425C-43CD-AA2A-(E-Mail Removed)...
>> >I need help to perform this task.
>> >
>> > For dt=2 to 1000
>> > If cells(dt,1)=date then Copy paste special this row.
>> > Next dt
>> >

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks =?Utf-8?B?d2xsZWU=?= Microsoft Excel Misc 7 3 Days Ago 07:00 AM
Special Copy, Paste Special macro usmc-r70 Microsoft Excel Programming 3 2nd Jul 2009 08:12 AM
HELP - Excel 2003 cut, copy, paste and paste special problems Carrie Microsoft Excel Crashes 2 9th Dec 2008 06:36 PM
Automating copy/paste/paste special when row references change Carl LaFong Microsoft Excel Programming 4 8th Oct 2007 06:10 AM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Microsoft Excel Programming 3 7th Aug 2004 09:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:12 AM.