-
Oct 4th, 2012, 12:03 PM
#1
Thread Starter
New Member
Copy the cells to adjacent after auto filter.
Team,
I have some values in column A where they include the negative and positive values and where i wrote the below one to filter and copy the same in adjacent column.
But i require is After filtering if a3, a7, a8 are having negative values they should copy to adjacent cells that is b3, b7, b8.Am unable to get it.
Please help........
Sub AutoFilter_in_Excel()
Range("A1").AutoFilter Field:=1, Criteria1:="<0", Operator:=xlAnd
Worksheets("sheet1").Range("A2:A7").Copy _
Destination:=Worksheets("sheet1").Range("c2")
Range("A1").AutoFilter Field:=1, Criteria1:=">0", Operator:=xlAnd
Worksheets("sheet1").Range("A2:A7").Copy _
Destination:=Worksheets("sheet1").Range("b2")
End Sub
-
Oct 4th, 2012, 12:17 PM
#2
Re: Copy the cells to adjacent after auto filter.
Thread moved to the 'Office Development/VBA' forum... note that while it certainly isn't made clear, the "VB Editor" in Office programs is actually VBA rather than VB, so the 'VB6' forum is not really apt
-
Oct 5th, 2012, 12:17 PM
#3
Re: Copy the cells to adjacent after auto filter.
If you know which cells you need to check, it can be like this:
Code:
If Range("a3").Value < 0 Then Range("b3").Value = Range("a3").Value
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|