Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Copy yellow shaded rows to another worksheet

Dear Experts:

The active worksheet of an excl-file has numerous rows with a yellow
fill.

I would like to have these yellow shaded rows copied automatically
(via VBA) to sheet 4 (Name of this sheet is: NoMatch) with no blank
rows in between.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Copy yellow shaded rows to another worksheet

On Jun 19, 3:08*pm, andreashermle wrote:
Dear Experts:

The active worksheet of an excl-file has numerous rows with a yellow
fill.

I would like to have these yellow shaded rows copied automatically
(via VBA) to sheet 4 (Name of this sheet is: NoMatch) with no blank
rows in between.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas


This works with Yellow #6:

Sub MoveYellow()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = ActiveSheet
Set s2 = Sheets("NoMatch")
s2.Activate
If IsEmpty(Range("A1")) Then
i = 1
Else
i = Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
s1.Activate
j = Cells(Rows.Count, "A").End(xlUp).Row
For n = 1 To j
If Cells(n, "A").Interior.ColorIndex = 6 Then
Cells(n, "A").EntireRow.Copy s2.Cells(i, "A")
i = i + 1
End If
Next
End Sub


Another good place to post questions of this type is:

http://social.answers.microsoft.com/...0-047e4781dcf4
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Copy yellow shaded rows to another worksheet

On Jun 19, 11:23*pm, James Ravenswood
wrote:
On Jun 19, 3:08*pm, andreashermle wrote:

Dear Experts:


The active worksheet of an excl-file has numerous rows with a yellow
fill.


I would like to have these yellow shaded rows copied automatically
(via VBA) to sheet 4 (Name of this sheet is: NoMatch) with no blank
rows in between.


Help is much appreciated. Thank you very much in advance.


Regards, Andreas


This works with Yellow #6:

Sub MoveYellow()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = ActiveSheet
Set s2 = Sheets("NoMatch")
s2.Activate
If IsEmpty(Range("A1")) Then
* * i = 1
Else
* * i = Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
s1.Activate
j = Cells(Rows.Count, "A").End(xlUp).Row
For n = 1 To j
* * If Cells(n, "A").Interior.ColorIndex = 6 Then
* * * * Cells(n, "A").EntireRow.Copy s2.Cells(i, "A")
* * i = i + 1
End If
Next
End Sub

Another good place to post questions of this type is:

http://social.answers.microsoft.com/...prog/threads?f...


Hi James,

exactly what I wanted. I works just fine.

Thank you very much for your professional help.

Regards, Andreas
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
Count yellow-highlited rows Vic Excel Discussion (Misc queries) 1 December 9th 09 10:32 PM
Count yellow-highlited rows Luke M Excel Discussion (Misc queries) 0 December 9th 09 09:17 PM
shaded rows sunderland27 Excel Discussion (Misc queries) 3 April 10th 06 06:33 PM
Shaded cells on a worksheet but do not show up on printed copy? Deborah Kinney Excel Worksheet Functions 1 March 6th 06 09:18 PM
formula for if Cell c1 is yellow shaded cell d1 should be yellow Hardeep Excel Discussion (Misc queries) 1 October 27th 05 02:58 PM


All times are GMT +1. The time now is 07:57 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"