Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default copy paste code not working(troubleshoot pls)

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default copy paste code not working(troubleshoot pls)

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default copy paste code not working(troubleshoot pls)

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default copy paste code not working(troubleshoot pls)

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste not working in excel Roshan Excel Discussion (Misc queries) 1 March 17th 10 03:34 AM
Copy paste only working once Danny Excel Discussion (Misc queries) 2 February 17th 09 09:38 AM
copy/paste not working chicago1 Excel Worksheet Functions 3 March 5th 08 05:20 PM
Copy and Paste Not Working dstromain Excel Discussion (Misc queries) 1 October 14th 05 01:39 PM
copy paste is not working Becky1810 Excel Discussion (Misc queries) 1 July 16th 05 02:12 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"