Hi all,
I need assistance with a code that would just copy the first 4 rows of a filtered range.
Thanks
Hi all,
I need assistance with a code that would just copy the first 4 rows of a filtered range.
Thanks
Charles
There are other ways to do this, this is but 1 !
Be Sure you thank those who helped.
IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.
Copy them where? Please post a sample sheet so that someone can help you
Mallycat,
My question was generic. Sorry for that.
Attached is a copy of the filtered data.
I'm looking to copy only the first 4 rows of column "E"
And then paste to the sheet result (Transposed).
I know this can be done manually, but am trying to do it by code.
I know the code to copy the first row to the last row, but in this case I only need the first 4 rows
of the filtered data.
Try
![]()
Sub CopyAndPaste() Dim x As Integer, y As Integer x = 1: y = 1 With Worksheets("start") Do If .Cells(x, 1) = "Active" And .Cells(x, 3) = "Active" Then .Cells(x, 5).Copy Worksheets("results").Cells(2, y) y = y + 1 End If x = x + 1 Loop Until y = 5 End With End Sub
JieJenn,
Thanks for the code. For some reason I the way you did the code would not work. Dummy me I did try to do it that way.
My first thought was to "Just" copy the first rows at the same time ( not as you provided) of column E and paste to result. But I could not figure out to just copy the needed rows.
Any way thanks for it.
hi Charles, option with autofilter, please check attachment
watersev,
Thanks for the code.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks