View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sotomayor Sotomayor is offline
external usenet poster
 
Posts: 1
Default Copy range based on condition

Hi

Newbie here hoping some help. I have this code to copy a whole range to
another worsheet:
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = Sheets("Sales-Inventory").Range("UPC",
Range("MK_ID").End(xlDown))
Set rng2 = Sheets("Sales-Inventory").Range("Figure",
Range("Figure").End(xlDown))
rng1.Copy
Sheets("BAUCS").Range("C11").PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
rng2.Copy
Sheets("BAUCS").Range("C37").PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Application.CutCopyMode = True

End Sub

The problem with this code is that copies the whole range and I need to
change this code to look into column A and copy the values based on the value
located in this column to the corresponding worsheet. In column A I have six
options like this: RE,AS, KJ, JC, XC, MN I need to copy cells B, C and P to
differents worsheets which are named the same as the six options I mentioned
before. Did I explain clearly? Let me know.

Can anybody help me with this, please.

Thanks