PC Review


Reply
Thread Tools Rate Thread

Cut & Paste data in new Worksheet

 
 
=?Utf-8?B?TWFuZGVlcCBEaGFtaQ==?=
Guest
Posts: n/a
 
      10th Aug 2007
Hello,

I have data in excel with columns from A:T and about 100+ rows.

I need a macro which finds out difference between column 'K' and column 'O'
and if the difference is ZERO cuts the data from existing worksheet and
copies it over to new worksheet in same file. The same row by row comparison
should be done for all the rows in the data.

Let me know if it is possible to do such through macro. If you can provide
me the email id, I can forward the same in soft copy as well.

Cheers,
Mandeep Dhami

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      10th Aug 2007
Sub CopyData()
Dim rng as range, rng1 as Range, cell as range
set rng = Range(cells(2,1),cells(rows.count,1).End(xlup))
for each cell in rng
if abs(abs(cells(cell.row,"K"))-abs(Cells(cell.row,"O"))) < .000001 then
if rng1 is nothing then
set rng1 = cell
else
set rng1 = union(rng1,cell)
end if
end if
Next
if not rng1 is nothing then
rng1.EntireRow.copy worksheets("Sheet2").Range("A1")
rng1.EntireRow.Delete
end if
End Sub

test it on a copy of your data. adjust sheet names to reflect yours. Run
the macro with the sheet with the data as the activesheet.

--
Regadrs,
Tom Ogilvy

"Mandeep Dhami" wrote:

> Hello,
>
> I have data in excel with columns from A:T and about 100+ rows.
>
> I need a macro which finds out difference between column 'K' and column 'O'
> and if the difference is ZERO cuts the data from existing worksheet and
> copies it over to new worksheet in same file. The same row by row comparison
> should be done for all the rows in the data.
>
> Let me know if it is possible to do such through macro. If you can provide
> me the email id, I can forward the same in soft copy as well.
>
> Cheers,
> Mandeep Dhami
>

 
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
Cannot paste column data from one worksheet to another stevemalee Microsoft Excel Worksheet Functions 2 30th Aug 2009 09:53 PM
Copy data from one worksheet and paste into another worksheet stockton12 Microsoft Excel Programming 3 30th Mar 2008 09:40 PM
Get data from all workbooks in a folder. Paste into my worksheet. =?Utf-8?B?SmVyZW15IFIu?= Microsoft Excel Programming 8 13th Jun 2007 05:41 PM
Re: Paste a chart and get the source data to be from the new worksheet Jon Peltier Microsoft Excel Charting 0 4th Aug 2006 04:36 PM
How can i copy and paste data when there is a filter in the worksheet.... dalipsinghbisht Microsoft Excel Misc 5 18th Mar 2006 12:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 AM.