ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Rows that have a Green font color to another worksheet (https://www.excelbanter.com/excel-programming/353102-copy-rows-have-green-font-color-another-worksheet.html)

mrdata

Copy Rows that have a Green font color to another worksheet
 

Hi I really need some help.

I have a worksheet with columns A-P Rows 5 - 350

Some rows I have green font color the rest are black font color

I have the letter "G" for green in the column P for the rows that are
green.

I need to code a command button that will look for the letter "G" and
get these green rows and copy them to another worksheet titlled "Rolls
to be Pulled" in the same workbook.

I have tried everything I can think of Please help.

Thanks
Charles Alexander


--
mrdata
------------------------------------------------------------------------
mrdata's Profile: http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=511536


Tom Ogilvy

Copy Rows that have a Green font color to another worksheet
 
What is in column P for the rows that do not have green font's in them. Are
the "G"'s hard coded or produced by formulas.

Assume Hardcoded and not green rows are blank

Private Sub CommandButton1_Click()
Dim rng as Range
On Error Resume Next
set rng = Me.Columns("P").Specialcells(xlConstants,xlTextVal ues)
On Error goto 0
if not rng is nothing then
rng.EntireRow.copy Destination:=Worksheets("Rolls to be Pulled").Cells(2,1)
Else
msgbox "No cells found"
End if
End Sub

--
Regards,
Tom Ogilvy


"mrdata" wrote in
message ...

Hi I really need some help.

I have a worksheet with columns A-P Rows 5 - 350

Some rows I have green font color the rest are black font color

I have the letter "G" for green in the column P for the rows that are
green.

I need to code a command button that will look for the letter "G" and
get these green rows and copy them to another worksheet titlled "Rolls
to be Pulled" in the same workbook.

I have tried everything I can think of Please help.

Thanks
Charles Alexander


--
mrdata
------------------------------------------------------------------------
mrdata's Profile:

http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=511536




mrdata[_2_]

Copy Rows that have a Green font color to another worksheet
 

Hi Tom

The "G" in column (P) refers to the row font color Green
I'm using this to paint the row font colors without having to do it
manualy

The code you wrote copies all the rows to the correct worksheet
I only want to copy the green rows

Thanks for your help


--
mrdata
------------------------------------------------------------------------
mrdata's Profile: http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=511536


Tom Ogilvy

Copy Rows that have a Green font color to another worksheet
 
You didn't answer any of the questions I asked.

Based on what you did say, it looks like you have other than G's in column
P.

Sub CopyDate()
Columns("P:P").Select
Selection.AutoFilter Field:=1, Criteria1:="G"
Selection.EnireRow.Copy _
Worksheets("Rolls to be Pulled").Cells(2,1)
Worksheets("Rolls to be Pulled").Rows(2).Delete
End Sub



--
Regards,
Tom Ogilvy


"mrdata" wrote in
message ...

Hi Tom

The "G" in column (P) refers to the row font color Green
I'm using this to paint the row font colors without having to do it
manualy

The code you wrote copies all the rows to the correct worksheet
I only want to copy the green rows

Thanks for your help


--
mrdata
------------------------------------------------------------------------
mrdata's Profile:

http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=511536




mrdata[_3_]

Copy Rows that have a Green font color to another worksheet
 

Tom:

Sorry about the misunderstanding

First the G's are not hard coded or entered by formula they are simply
typed
in the cells of column (P) the other Characters in column (P) are as
follows

R for red
B for blue
BR for brown
P for pink or Magenta
O for Orange

A for loop I have coded loops through column (P) and changes the entire
row
the color of the Character in column (P)

I need to pick out all the green rows and copy them to
another worksheet that is already in the workbook "Rolls to be Pulled"

Any help is appreciated
Thanks
Charles


--
mrdata
------------------------------------------------------------------------
mrdata's Profile: http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=511536


mrdata[_4_]

Copy Rows that have a Green font color to another worksheet
 

There has to be a way to do this I just can't seem to figure it out.


--
mrdata
------------------------------------------------------------------------
mrdata's Profile: http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=511536


mrdata[_5_]

Copy Rows that have a Green font color to another worksheet
 

Tom Ogilvy


This code you wrote almost works the way I want it to

But I only want to copy the rows that the text is green
Can you help me modify the code I have tried to but I don't have th
know how to make it work.

Dim rng as Range
On Error Resume Next
set rng = Me.Columns("P").Specialcells(xlConstants,xlTextVal ues)
On Error goto 0
if not rng is nothing then
rng.EntireRow.copy Destination:=Worksheets("Rolls to b
Pulled").Cells(2,1)
Else
msgbox "No cells found"
End if

Thanks
Charle

--
mrdat
-----------------------------------------------------------------------
mrdata's Profile: http://www.excelforum.com/member.php...fo&userid=1789
View this thread: http://www.excelforum.com/showthread.php?threadid=51153



All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com