heres one for ya..

  • Thread starter Thread starter alan_bourne
  • Start date Start date
A

alan_bourne

ok i need to imput a cell into an auto filter again but i have tried t
edit the code from another one but no such luck.... i need to imput
number from (customerdetails!A2) into an autofilter in row a on th
sheet (sales) column A this needs to paste another one each tim
underneath when i click a button but all i need is the macro code as
can do butons.

i have attached the file so u can see what i mean thanks for any hel
you can giv

+----------------------------------------------------------------
| Attachment filename: help.xls
|Download attachment: http://www.excelforum.com/attachment.php?postid=357484
+----------------------------------------------------------------
 
I assume you want to match the filter criteria on the second sheet with the
filter criteria on the first sheet.

Sub MatchFilter()
Dim f1 As Filter
Set f1 = Worksheets("CustomerDetails") _
.AutoFilter.Filters(1)
If f1.On Then
If f1.Operator Then
Worksheets("Sales").Range("A16").AutoFilter _
Field:=1, Criteria1:=f1.Criteria1, _
Operator:=f1.Operator, _
Criteria2:=f1.Criteria2
Else
Worksheets("Sales").Range("A16").AutoFilter _
Field:=1, Criteria1:=f1.Criteria1
End If
Else
MsgBox "Filter on column A is not ON"
End If
End Sub
 
ummm that seems to spoon up my page two but its not really wat i need.
what im after is what ever cell A2 is in "customer details" at that
current time to added into column A in "sales" to create a new entry
for another product because in other pages that i have i click a button
which automaticaly adds a product into column b and replicates its self
(as you "tom" helped me with the other day). The file is attached
above.

So cell A2 in Customer details is to be coppied to sales in column A
after it is created it then needs to place it below when i click again
on the buton.

Thanks again for all of your help

Alan Bourne
 
Sub Copydata2()

Worksheets("CustomerDetails").Range("A2").Copy _
Destination:=worksheets("Sales").Cells(rows.count,1).End(xlup)(2)
End Sub
 
Back
Top