PC Review


Reply
Thread Tools Rate Thread

copy data in turqouise colour cells from n to a

 
 
pswanie
Guest
Posts: n/a
 
      12th Mar 2008
Private Sub CommandButton1_Click()
NewRowCount = 1
Lastrow = Range("N" & Rows.Count).End(xlUp).Row
For RowCount = 1 To Lastrow
If Range("N" & RowCount).Interior.ColorIndex = 8 Then
Range("d" & NewRowCount) = Range("N" & RowCount)
NewRowCount = NewRowCount + 1
End If
Next RowCount

End Sub



i got this string from joel... (thanx) but does not do what i need. in
fact clicking on the command button does nothing.


what i need is to copy all data in the cells with turqoise (8) colour from
column N to colum A.
 
Reply With Quote
 
 
 
 
paul.robinson@it-tallaght.ie
Guest
Posts: n/a
 
      12th Mar 2008
Hi
Code looks OK, except you need to change "d" to "A".
You might find this easier to run from a form button. Go to View,
Toolbars, Forms and click on the grey button icon. Drag out the button
shape with your mouse and assign the macro below:

Public Sub CopyIt()
NewRowCount = 1
Lastrow = Range("N" & Rows.Count).End(xlUp).Row
For RowCount = 1 To Lastrow
If Range("N" & RowCount).Interior.ColorIndex = 8 Then
Range("A" & NewRowCount) = Range("N" & RowCount)
NewRowCount = NewRowCount + 1
End If
Next RowCount

End Sub

The code is in a general code module. I suspect your commandbutton
code does not run because it is in the wrong place.

regards
Paul

On Mar 12, 7:54*am, pswanie <pswa...@discussions.microsoft.com> wrote:
> Private Sub CommandButton1_Click()
> NewRowCount = 1
> Lastrow = Range("N" & Rows.Count).End(xlUp).Row
> For RowCount = 1 To Lastrow
> * *If Range("N" & RowCount).Interior.ColorIndex = 8 Then
> * * * Range("d" & NewRowCount) = Range("N" & RowCount)
> * * * NewRowCount = NewRowCount + 1
> * *End If
> Next RowCount
>
> End Sub
>
> i got this string from joel... * (thanx) * but does not do what i need.. *in
> fact clicking on the command button does nothing.
>
> what i need is to copy all data in the cells with turqoise (8) colour from
> column N to colum A.


 
Reply With Quote
 
pswanie
Guest
Posts: n/a
 
      12th Mar 2008
i still cant get it to work....

i took liberty to mail a copy to u

the lines go on to 380. but i took some of it out


 
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
how do I copy format (eg colour of cells) in a drop down list SamR Microsoft Excel Worksheet Functions 1 9th Dec 2009 07:01 PM
how do I copy format (eg colour of cells) in a drop down list SamR Microsoft Excel Worksheet Functions 0 9th Dec 2009 04:28 AM
select, copy and past all cells with specific colour pswanie Microsoft Excel Programming 9 12th Mar 2008 03:52 PM
how do I get cells to automaticly change colour on data input? walltur Microsoft Excel Worksheet Functions 2 4th Feb 2008 02:46 PM
Copy Colour and Data within cells not borders MO Microsoft Excel Misc 2 7th May 2004 05:31 PM


Features
 

Advertising
 

Newsgroups
 


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