Home VBA Code works on one tab and not others
Reply: 0

VBA Code works on one tab and not others

user445
1#
user445 Published in July 22, 2018, 8:36 am

the code below only seems to run when I am on the 'Site' tab and no other tab. Can somebody explain why?

Sub GroupReport()

Dim vRegion As String

vRegion = Sheets("Region").Range("A3").Value

Sheets("Site").Cells.AutoFilter

Sheets("Site").Range("A1").AutoFilter Field:=1, Criteria1:=vRegion

Sheets("Site").Range("B2", Range("b2").End(xlDown)).Copy Destination:=Sheets("Region").Range("A8")

End Sub
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.318211 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO