PC Review


Reply
Thread Tools Rate Thread

Copy yellow shaded rows to another worksheet

 
 
andreashermle
Guest
Posts: n/a
 
      19th Jun 2010
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
 
Reply With Quote
 
 
 
 
James Ravenswood
Guest
Posts: n/a
 
      19th Jun 2010
On Jun 19, 3:08*pm, andreashermle <andreas.her...@gmx.de> 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
 
Reply With Quote
 
andreashermle
Guest
Posts: n/a
 
      20th Jun 2010
On Jun 19, 11:23*pm, James Ravenswood <james.ravensw...@gmail.com>
wrote:
> On Jun 19, 3:08*pm, andreashermle <andreas.her...@gmx.de> 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 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
Copy rows from one worksheet automatically, ignore rows that are b Kris Microsoft Excel Worksheet Functions 2 10th Oct 2008 09:28 PM
Copy Rows From Worksheet Into Another Worksheet Same Workbook =?Utf-8?B?Sm9lIEsu?= Microsoft Excel Programming 6 7th Oct 2007 09:44 PM
Find all rows of a color and copy those rows to a new worksheet =?Utf-8?B?aHNoYXloMHJu?= Microsoft Excel Programming 3 26th May 2006 08:34 PM
Shaded cells on a worksheet but do not show up on printed copy? =?Utf-8?B?RGVib3JhaCBLaW5uZXk=?= Microsoft Excel Worksheet Functions 1 6th Mar 2006 09:18 PM
formula for if Cell c1 is yellow shaded cell d1 should be yellow =?Utf-8?B?SGFyZGVlcA==?= Microsoft Excel Misc 1 27th Oct 2005 02:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:09 PM.