Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have data in cells A1..L1. I have a condition (A,B or C) in cells
H30..S30. Cell A1 corresponds to h30, B1 to I30, etc. I need a routine that will copy and paste the data down 6 rows based up on the condition. So for each cell in H30..S30 that has A in it, the routine will then paste the value 6 rows down. Any help is appreciated. Regards |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This may get you started. You can modify the range as needed.
Sub Copyif() Dim MyRange As Range Dim MyCell As Range Set MyRange = Range("H30:S30") For Each MyCell In MyRange If MyCell.Value = "A" Then MyCell.Copy Destination:=Range(MyCell.Address) _ .Offset(6, 0) End If Next End Sub Ronbo wrote: I have data in cells A1..L1. I have a condition (A,B or C) in cells H30..S30. Cell A1 corresponds to h30, B1 to I30, etc. I need a routine that will copy and paste the data down 6 rows based up on the condition. So for each cell in H30..S30 that has A in it, the routine will then paste the value 6 rows down. Any help is appreciated. Regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
A visual basic value copy BUG?? - accounting format has copy problem!! | Excel Programming | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
copy formulas from a contiguous range to a safe place and copy them back later | Excel Programming | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel |