Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Cut & Paste data in new Worksheet

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
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
Cannot paste column data from one worksheet to another stevemalee[_2_] Excel Worksheet Functions 2 August 30th 09 09:53 PM
Paste a chart and get the source data to be from the new worksheet Excelfool Charts and Charting in Excel 5 August 25th 06 05:06 PM
Paste a chart and get the source data to be from the new worksheet Jon Peltier Charts and Charting in Excel 0 August 4th 06 04:36 PM
How can i copy and paste data when there is a filter in the worksheet.... dalipsinghbisht Excel Discussion (Misc queries) 5 March 18th 06 12:38 PM
Paste data from another worksheet Chapman76 Excel Worksheet Functions 0 April 5th 05 06:09 PM


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

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

About Us

"It's about Microsoft Excel"