PC Review


Reply
Thread Tools Rate Thread

copy paste code not working(troubleshoot pls)

 
 
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
 
 
 
 
Joel
Guest
Posts: n/a
 
      12th Mar 2008
You have column d instead of column A. If you want to preserve the color
than you need to copy the cell rather than equal.

Did you put a break point in the code to make sure the command button was
working?

NewRowCount = 1
Lastrow = Range("N" & Rows.Count).End(xlUp).Row
For RowCount = 1 To Lastrow
If Range("N" & RowCount).Interior.ColorIndex = 8 Then
Range("N" & RowCount).Copy _
Destination:=Range("A" & NewRowCount)
NewRowCount = NewRowCount + 1
End If
Next RowCount

"pswanie" 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
break point i did. not to bright on what that mean yet. so i cant say if
what should hapen did..... can i mail a copy of the workbook to you to
check? Please

Phillip
 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      12th Mar 2008
Break point will indicate that the button is working.

send to joel dot warburg at itt dot com

"pswanie" wrote:

> break point i did. not to bright on what that mean yet. so i cant say if
> what should hapen did..... can i mail a copy of the workbook to you to
> check? Please
>
> Phillip

 
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 and paste not working Daniel Windows Vista General Discussion 7 23rd Oct 2007 08:07 AM
Copy and Paste not working Jane M. Windows XP Help 9 27th Apr 2007 06:35 AM
Cut, Copy, Paste, and Paste Special not working =?Utf-8?B?RWR1YXJkbw==?= Microsoft Excel Crashes 2 27th Oct 2005 08:01 PM
Clip and paste commands aren't working; cannot copy and paste; ca. =?Utf-8?B?cHV6emxlZGluVFg=?= Microsoft Word Document Management 2 9th Nov 2004 02:33 PM
copy paste not working amit berry Microsoft Windows 2000 1 18th Aug 2003 01:12 PM


Features
 

Advertising
 

Newsgroups
 


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