Hi everyone,
Long time lurker, first time poster - I'm not great with VBA to begin with and I'm at my wits end, so I'm hoping someone can help me.
I am trying to create a button on Sheet1 that, when pressed, will search for "X" in Column F of Sheet2 and copy the full contents of that row onto Sheet3. You following me so far?
I'm using this code, pilfered from the internet:
When I click the button, I get the following error:
Run-time error '1004':
AutoFilter method of Range class failed
I've tried everything I can think of but I'm stumped. I'm sure it's probably something very obvious, but just not to me. Can anyone advise? Thanks!
Long time lurker, first time poster - I'm not great with VBA to begin with and I'm at my wits end, so I'm hoping someone can help me.
I am trying to create a button on Sheet1 that, when pressed, will search for "X" in Column F of Sheet2 and copy the full contents of that row onto Sheet3. You following me so far?
I'm using this code, pilfered from the internet:
Code:
Private Sub Create_Click()
Application.ScreenUpdating = False
With Sheet2
.AutoFilterMode = False
With Range("F1", Range("F" & Rows.Count).End(xlUp))
.AutoFilter 1, "X"
On Error Resume Next
.Offset(1).EntireRow.Copy Sheet3.Range("A" & Rows.Count).End(xlUp).Offset(1)
End With
.AutoFilterMode = False
End With
Application.ScreenUpdating = True
Sheet3.Select
End Sub
When I click the button, I get the following error:
Run-time error '1004':
AutoFilter method of Range class failed
I've tried everything I can think of but I'm stumped. I'm sure it's probably something very obvious, but just not to me. Can anyone advise? Thanks!