Wants to filter and copy from sheet2 but without activating sheet2

NileshAPatel

New Member
Joined
May 29, 2021
Messages
26
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Dear Team,

I have a excel file wherein 2 sheets are their.
From Sheet1, wants to filter data in sheet2 table and copy and paste filtered data in sheet1 A1 cell.
Is is possible get it done through sheet1 itself without activating or selecting sheet2

Thanks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Dear Team,

I have a excel file wherein 2 sheets are their.
From Sheet1, wants to filter data in sheet2 table and copy and paste filtered data in sheet1 A1 cell.
Is is possible get it done through sheet1 itself without activating or selecting sheet2

Thanks
Sure that can be done. Give us specific details about both sheet names and filter with what criteria.
 
Upvote 0
sorry excel file can't attached. please find attached
Model.xlsx
I
11
Sheet1


Model.xlsx
D
2Model
Sheet2
 
Upvote 0
I never download files.
Are you not able to explain in words how you want to filter the sheet?
 
Upvote 0
Sheet1 and sheet2 snap are attached herewith.

Wants to filter Sheet2 table in header "Model" with "DZIRE" only and copy filtered data on sheet1 Cell A5

Wants to do it without selecting sheet2


Thanks in advance....
 

Attachments

  • Sheet1 Format.JPG
    Sheet1 Format.JPG
    26.8 KB · Views: 9
  • Sheet2 Table Format.JPG
    Sheet2 Table Format.JPG
    141.3 KB · Views: 9
Upvote 0
Dear Team,

Please find format for your reference.

Model.xlsx
ABCDEF
2
3
4Outlet NameSupplier CategorySupplierModelSubModel CodeSubModel
5
6
7
8
9
10
Sheet1



Model.xlsx
ABCDEFG
1
2Outlet NameSupplier CategorySupplierModelSubModel CodeSubModel
30102-01SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
40112-01SupplierMaruti Suzuki India Ltd. - GJDZIREDRR4DV200NEW DZIRE VXI 1.2 L BS-VI
5P601-P6SupplierMaruti Suzuki India Ltd. - GJDZIREDRR4DV200NEW DZIRE VXI 1.2 L BS-VI
60102-01SupplierMaruti Suzuki India Ltd. - GJDZIREDRR4DV200NEW DZIRE VXI 1.2 L BS-VI
70106-01SupplierMaruti Suzuki India Ltd. - GJDZIREDRR4DV200NEW DZIRE VXI 1.2 L BS-VI
8P601-P6SupplierMaruti Suzuki India Ltd. - GJERTIGAERRCBV100ERTIGA VXI CNG - BS VI
92201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
102201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
112201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
122201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
132201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
142201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
152201-40SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
160102-01SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
170106-01SupplierMaruti Suzuki India Ltd. - GJERTIGAERRCTL200ERTIGA Tour M (CNG) - BS VI
180106-01SupplierMaruti Suzuki India Ltd. - GJERTIGAERRCTL200ERTIGA Tour M (CNG) - BS VI
192201-22SupplierMaruti Suzuki India Ltd. - GJERTIGAERRCTL200ERTIGA Tour M (CNG) - BS VI
20P601-P6SupplierMaruti Suzuki India Ltd. - GJWAGON-RWARCCLA00WagonR Lxi (O) CNG BS-VI
210112-01SupplierMaruti Suzuki India Ltd. - GJNEW SWIFTSRR4DV100NEW SWIFT VXI BS-VI
220106-01SupplierMaruti Suzuki India Ltd. - GJNEW SWIFTSRR4DV100NEW SWIFT VXI BS-VI
230112-01SupplierMaruti Suzuki India Ltd. - GJNEW SWIFTSRR4DV100NEW SWIFT VXI BS-VI
240112-01SupplierMaruti Suzuki India Ltd. - GJALTO 800ANRCALB00MARUTI ALTO LXI (O) CNG BS-VI
25
26
Sheet2


Thanks
 
Upvote 0
Try this:
VBA Code:
Option Explicit
Sub Filter_Me_Please()
'Modified  12/23/2021  3:42:02 AM  EST
Application.ScreenUpdating = False
Dim Lastrow As Long
Dim C As Long
Dim s As Variant
Dim counter As Long
C = 4 ' Column Number Modify this to your need
s = "DZIRE" 'Search Value Modify to your need
Lastrow = Sheets(2).Cells(Rows.Count, C).End(xlUp).Row

With Sheets(2).Cells(1, C).Resize(Lastrow)
    .AutoFilter 1, s
    counter = .Columns(C).SpecialCells(xlCellTypeVisible).Count
    If counter > 1 Then
        .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets(1).Cells(5, 1)
    Else
        MsgBox "No values found"
    End If
    .AutoFilter
End With
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks for prompt revert
Error is showing while running macro...

Screen shot is attached herewith

Error comes in " .AutoFilter 1, s " step.

Thanks
 

Attachments

  • Error Capture2.JPG
    Error Capture2.JPG
    119.5 KB · Views: 6
  • Error Capture1.JPG
    Error Capture1.JPG
    134.8 KB · Views: 6
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,946
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top