Hello, I want to filter column A on a specific value and copy the data to another sheet so that the data is pasted info b12 . For example, the problem we are facing is that I want to copy the value of cell M2 from sheet 1 to sheet 2 next to the transferred values and with the same number of rows that were filtered and transferred.
in column A and E
And when re-continuous again is copying down the old data
Public Sub drewhx15()
Dim Rng As Range
With ThisWorkbook.Worksheets("feuil1")
Set Rng = .Range("b5:d" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With
With Rng
.AutoFilter Field:=1, Criteria1:="ok"
.Offset(1, 1).Resize(.Rows.Count - 1, .Columns.Count - 1).Copy ThisWorkbook.Worksheets("Sh").Range("b12")
.AutoFilter Field:=1, Criteria1:="yes"
.Offset(1, 1).Resize(.Rows.Count - 1, .Columns.Count - 1).Copy ThisWorkbook.Worksheets("Sh").Range("F12")
.Parent.AutoFilterMode = False
End With
End Sub
in column A and E
And when re-continuous again is copying down the old data
Public Sub drewhx15()
Dim Rng As Range
With ThisWorkbook.Worksheets("feuil1")
Set Rng = .Range("b5:d" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With
With Rng
.AutoFilter Field:=1, Criteria1:="ok"
.Offset(1, 1).Resize(.Rows.Count - 1, .Columns.Count - 1).Copy ThisWorkbook.Worksheets("Sh").Range("b12")
.AutoFilter Field:=1, Criteria1:="yes"
.Offset(1, 1).Resize(.Rows.Count - 1, .Columns.Count - 1).Copy ThisWorkbook.Worksheets("Sh").Range("F12")
.Parent.AutoFilterMode = False
End With
End Sub