View Single Post
 
Old 06-22-2014, 01:39 PM
shilabrow shilabrow is offline Windows Vista Office 2007
Advanced Beginner
 
Join Date: Apr 2014
Posts: 45
shilabrow is on a distinguished road
Default

Thanks BobBridges for your input. I have below the following code, you were right, I typed the code in hope the below helps because Its copied in - your help appreciated. The Listobjects is referencing database query, its pulling data from database. I want to add more criteria to it, I have a field named Activity in the table pulled from the database which has nos in them as 4, 5, 6 but I want them changed that is why I want to change those no to Book, Elephant, Hunter:
The criteria is:
For fieldName (Activity) in the Table, whenever it sees 4 under Activity field should change to Book, 5 to Elephant, 6 to Hunter.


Sub Trials()
'
' Trials Macro
'
'
Selection.AutoFilter
ActiveSheet.ListObjects("Table_Query_from_MS_Acces s_Database").Range. _
AutoFilter Field:=4, Criteria1:="Yes"
ActiveSheet.ListObjects("Table_Query_from_MS_Acces s_Database").Range. _
AutoFilter Field:=6, Criteria1:="Complete"
Cells.Select
Range("Table_Query_from_MS_Access_Database[[#Headers],[First Name]]").Activate
Selection.Copy
Sheets("Result").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
End Sub


Thanks Much.
Reply With Quote