Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

copy data in turqouise colour cells from n to a

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pswanie - 12 Mar 2008 08:54 GMT
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.
paul.robinson@it-tallaght.ie - 12 Mar 2008 10:10 GMT
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

> Private Sub CommandButton1_Click()
> NewRowCount = 1
[quoted text clipped - 13 lines]
> what i need is to copy all data in the cells with turqoise (8) colour from
> column N to colum A.
pswanie - 12 Mar 2008 11:11 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.