Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2015, 08:31 PM
Sandhya Sandhya is offline Extract the filter data Windows 7 32bit Extract the filter data Office 2007
Novice
Extract the filter data
 
Join Date: Nov 2014
Posts: 21
Sandhya is on a distinguished road
Arrow Extract the filter data

Hi,

I am using below code to extract the filter data, but it is giving probolem.


can any one help me to resolve the same.
Code:
Private Sub CommandButton1_Click()
Sheet1.Activate
Sheet1.Range("A1,G1").Select
Selection.Copy
Sheets("Sheet4").Select
Range("A1:B1").PasteSpecial
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Range("C4").Select
Sheets("Sheet1").Select
Application.CutCopyMode = False
Sheet1.Range("A3").Select
Sheets("Sheet4").Select
Sheets("Sheet1").Range("A1:G9").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Sheets("Sheet1").Range("I1:I2"), CopyToRange:=Sheets("Sheet4").Range("A1:B1"), Unique:=False
End Sub
Attached Files
File Type: xlsx Book1.xlsx (16.3 KB, 8 views)

Last edited by macropod; 10-25-2015 at 06:19 PM. Reason: Added code tags
Reply With Quote
  #2  
Old 10-25-2015, 02:57 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Extract the filter data Windows 7 64bit Extract the filter data Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,780
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Please wrap code with code tags - Thx
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 10-25-2015, 09:02 AM
NoSparks NoSparks is offline Extract the filter data Windows 7 64bit Extract the filter data Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

You don't say what the problem is but probably Sheet1 and Sheets("Sheet4") being the same sheet could have something to do with it.

In the VBA environment have a look at the Excel Objects for sheets.
The name on the left is the code name of the sheet and the name in brackets is the tab name.
Need to decide which you are going to use and be consistent.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba to Filter data saurabhlotankar Excel Programming 5 05-29-2015 06:07 AM
Extract the filter data Extract Excel Data from Chart in Word cillianmccolgan Word 1 08-15-2014 01:42 AM
Extract the filter data Extract data from web - Take a long time edneco Excel Programming 11 06-28-2014 05:54 PM
Extract the filter data How to Extract key data from word iliauk Word 3 11-08-2013 04:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft