PC Review


Reply
Thread Tools Rate Thread

copy rows to next sheet

 
 
K
Guest
Posts: n/a
 
      15th Dec 2007
is there any macro that if i want to copy only those rows (row lentgh
cell A to cell F) from sheet 1 to sheet 2 in which any cell in coloumn
B got Red colour by conditional formatting. Please just need the
macro if anybody can help. thanks
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      15th Dec 2007
Check your original posting.

"K" wrote:

> is there any macro that if i want to copy only those rows (row lentgh
> cell A to cell F) from sheet 1 to sheet 2 in which any cell in coloumn
> B got Red colour by conditional formatting. Please just need the
> macro if anybody can help. thanks
>

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      15th Dec 2007
Sub cpyColr()
Dim c As Range
lastRw = Worksheets(1).Cells(Rows.Count, 2).End(xlUp).Row
For Each c In Worksheets(1).Range("B2:B" & lastRw)
If c.FormatConditions.Count > 0 Then
If c.FormatConditions(1).Interior.ColorIndex = 3 Then
lstRw2 = Worksheets(2).Range("A65536").End(xlUp).Row
cRng = c.Address
Worksheets(1).Range("A" & Range(cRng).Row & ":F" & _
Range(cRng).Row).Copy Worksheets(2).Range("A" & lstRw2 + 1)
End If
End If
Next
End Sub


"K" wrote:

> is there any macro that if i want to copy only those rows (row lentgh
> cell A to cell F) from sheet 1 to sheet 2 in which any cell in coloumn
> B got Red colour by conditional formatting. Please just need the
> macro if anybody can help. thanks
>

 
Reply With Quote
 
K
Guest
Posts: n/a
 
      15th Dec 2007
On 15 Dec, 18:31, JLGWhiz <JLGW...@discussions.microsoft.com> wrote:
> Sub cpyColr()
> Dim c As Range
> lastRw = Worksheets(1).Cells(Rows.Count, 2).End(xlUp).Row
> For Each c In Worksheets(1).Range("B2:B" & lastRw)
> If c.FormatConditions.Count > 0 Then
> If c.FormatConditions(1).Interior.ColorIndex = 3 Then
> lstRw2 = Worksheets(2).Range("A65536").End(xlUp).Row
> cRng = c.Address
> Worksheets(1).Range("A" & Range(cRng).Row & ":F" & _
> Range(cRng).Row).Copy Worksheets(2).Range("A" & lstRw2 + 1)
> End If
> End If
> Next
> End Sub
>
>
>
> "K" wrote:
> > is there any macro that if i want to copy only those rows (row lentgh
> > cell A to cell F) from sheet 1 to sheet 2 in which any cell in coloumn
> > B got Red colour by conditional formatting. Please just need the
> > macro if anybody can help. thanks- Hide quoted text -

>
> - Show quoted text -


Thanks JLG
 
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 Data sheet to another sheet based on cell conte John McKeon Microsoft Excel Misc 2 15th May 2010 06:49 AM
copy rows to other sheet Carpe Diem Microsoft Excel Worksheet Functions 3 17th Dec 2007 06:58 PM
Copy rows onto existing sheet / start a new sheet if full mg_sv_r Microsoft Excel Programming 0 29th Nov 2007 12:57 PM
Search for rows in one sheet and copy into another sheet based on customer id chitiksha@gmail.com Microsoft Excel Worksheet Functions 1 22nd Oct 2007 03:09 AM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Microsoft Excel Programming 4 5th Oct 2007 04:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:47 PM.