Mac M
asked on
Access VBA Question
I have a Clear Form Button when clicked on my Excel Spreadsheet that is not clearing 2 records for some strange reason, can anyone possibly tell me why this is happening...Please review my code below....
Sub ClearForm()
'
' ClearForm Macro
'
'
Range("Table_Query_from_MS _Access_Da tabase").S elect
Selection.AutoFilter
Selection.AutoFilter
Range("Table_Query_from_MS _Access_Da tabase_1") .Select
Selection.AutoFilter
Selection.AutoFilter
Range("B3").Select
Selection.ClearContents
Range("B5").Select
Selection.ClearContents
Range("B7").Select
Selection.ClearContents
Range("Table_Query_from_MS _Access_Da tabase[[#H eaders],[G roupCode]] ").Select
Selection.ListObject.Query Table.Refr esh BackgroundQuery:=False
End Sub
Sub ClearForm()
'
' ClearForm Macro
'
'
Range("Table_Query_from_MS
Selection.AutoFilter
Selection.AutoFilter
Range("Table_Query_from_MS
Selection.AutoFilter
Selection.AutoFilter
Range("B3").Select
Selection.ClearContents
Range("B5").Select
Selection.ClearContents
Range("B7").Select
Selection.ClearContents
Range("Table_Query_from_MS
Selection.ListObject.Query
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Your macro is clearing just three cells. Nothing else..