LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default how to insert and color these rows

How do I accomplish the following:

1. I would like to add a line of description to the Destination
worksheet (such as "Comparison Results") in the Worksheets("Unique");

2. I would like to color the lines found in Sheet1 before they are
copied to Worksheets("Unique");

-----------------------------------------
With Worksheets("Sheet1")
Set rng1 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With

With Worksheets("Sheet2")
Set rng2 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With

For Each cell In rng1
res = Application.Match(cell, rng2, 0)
If Not IsError(res) Then
Set rng3 = rng2(res)
Set rng4 = Worksheets("Match").Cells(Rows.Count,
1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng4
Else
Set rng4 = Worksheets("Unique").Cells(Rows.Count,
1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng4
End If
Next
-------------------------------------

Many thanks.

 
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
How do i insert blank rows between data that is thousands of rows paul.eatwell Excel Discussion (Misc queries) 5 April 14th 08 10:49 PM
Insert rows: Formats & formulas extended to additonal rows Twishlist Excel Worksheet Functions 0 October 22nd 07 04:23 AM
How do I sort my data by color? (color applied to rows) TTownsend Excel Worksheet Functions 3 September 7th 06 09:49 PM
How do i insert of spacer rows between rows in large spreadsheets laurel Excel Discussion (Misc queries) 0 April 24th 06 01:38 PM
Copy Rows and insert these rows before a page break AQ Mahomed Excel Programming 0 June 8th 04 09:09 AM


All times are GMT +1. The time now is 10:35 PM.

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"