Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy/paste based on colour criteria

Hello to all

I am running a code at the moment that copies/pastes based on selection criteria within my workbook and would like to add to it. I have 2 criteria to add if possible????

The code below is fine but i would like to add the following

if within a row, column D is greater than 1 AND red, copy column A to column B.....and column D (content only) to column F. This is all to the same sheet as the rest of the code....VKnew. The tricky bit is, the row to start pasting may vary. The heading it should paste under is 'optionals/non-discount'

Is this possible? Do i have to nominate a row to start pasting from??? COuld someone write a separate code that only performs the function i have requested...maybe thats a better way??

Cheers to all!!!
Private Sub CommandButton3_Click(
CopyData Range("D9:D13"), "FEEDER
CopyData Range("D16:D58"), "MACHINE
CopyData Range("D63:D73"), "DELIVERY
CopyData Range("D78:D82"), "PECOM
CopyData Range("D88:D94"), "ROLLERS
CopyData Range("D104:D128"), "MISCELLANEOUS
Dim rng As Range, cell As Rang
Dim nrow As Long, rw As Lon
Dim col As Strin
Dim Sh As Workshee
Set rng = Range("D9:D94"
nrow = Application.CountIf(rng, "0"
Set Sh = Worksheets("VK new"
rw = 1
For Each cell In Range("D9:D98"
If Cells(cell.Row, "D").Interior.ColorIndex = 3 The
col = "G
Els
col = "F
End I
If Not IsEmpty(cell) The
If IsNumeric(cell) The
If cell 0 The
Cells(cell.Row, 1).Cop
Sh.Cells(rw, "A").PasteSpecial Paste:=xlPasteValue
Cells(cell.Row, 4).Cop
Sh.Cells(rw, col).PasteSpecial Paste:=xlPasteValue
Cells(cell.Row, 2).Cop
Sh.Cells(rw, "B").PasteSpecial Paste:=xlPasteValue
rw = rw +
End I
End I
End I
Nex
End Sub
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
SUMIF Criteria Auto-Update on Copy/Paste SeventFloorProfessor Excel Discussion (Misc queries) 4 December 12th 08 04:05 PM
Paste data based on multiple criteria Tacrier Excel Worksheet Functions 0 April 11th 08 05:18 PM
Copy and Paste based on Condition EJ Excel Discussion (Misc queries) 1 June 27th 07 11:17 PM
Cut & Paste Data into different worksheet based on specific criteria hailnorm[_2_] Excel Programming 2 December 6th 03 10:56 PM
Cut and Paste macro based on criteria then delete empty rows samst Excel Programming 4 November 2nd 03 09:33 PM


All times are GMT +1. The time now is 12:36 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"