LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select,copy,paste by color


What data? from where? in what order?
Why noy join our forum where you can attach a workbook that we can help
you with directly? if you do join the forum which is completely free,
make sure that you post in this thread http://tinyurl.com/dzy37e so that
people who have been following this thread or helping can continue to do
so!

Barry Lennox;193271 Wrote:
Thanks team
One more (I hope) variation. I am just coming out of using macros in
Escel
and have no training in VBA, just learning as I go. Ho do I copy my
information to an existing sheet say "invoice". I have tried playing
with the
code below, deleting and changing things but I give in, help please.

Barry

"The Code Cage Team" wrote:


Try this:

Code:
--------------------
Sub Move_Colours()
Dim Rng As Range, MyCell As Range
Dim Rng1 As Range
Dim MySheet As String, NewSheet As Worksheet
Dim i As Long
Dim IB As Variant
Set Rng = Range("B1:B100")
'if you have data in column B you can use the line below
'Set Rng = Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row)
i = 0
MySheet = ActiveSheet.Name
Worksheets.Add
ActiveSheet.Name = "Transferred Data"
Set NewSheet = ActiveSheet

Sheets(MySheet).Activate
'if you want to choose colours by number uncomment below
'ib=inputbox("Please enter the colour number you wish to

manipulate","Colour pick",6,,,,1)
For Each MyCell In Rng
'if using the colour pick above uncomment the line below
'If MyCell.Interior.ColorIndex = IB Then
'and comment out the next 2 lines
If MyCell.Interior.ColorIndex = 6 Or MyCell.Interior.ColorIndex = 5

_
Or MyCell.Interior.ColorIndex = 4 Or MyCell.Interior.ColorIndex = 3

Then
i = i + 1
MyCell.Copy
Set Rng1 = NewSheet.Range("A" & i)
With Rng1
.PasteSpecial Paste:=xlPasteFormats
.PasteSpecial Paste:=xlValues
End With
MyCell.Offset(0, -1).Copy Destination:=Rng1.Offset(0, 1)
MyCell.Offset(0, 1).Copy Destination:=Rng1.Offset(0, 2)
End If
Next MyCell
End Sub

--------------------






--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52699

 
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
How do I copy color text & paste keeping color bduck Excel Discussion (Misc queries) 3 April 12th 10 10:44 PM
Not using select for copy and paste damorrison Excel Discussion (Misc queries) 2 April 8th 07 08:41 PM
Select copy and paste David Rose Excel Programming 1 April 13th 05 05:17 PM
Select All and copy and paste Ashok[_2_] Excel Programming 7 November 11th 03 03:46 AM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM


All times are GMT +1. The time now is 10:55 PM.

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

About Us

"It's about Microsoft Excel"