vba filter data

Barry Au

New Member
Joined
Jun 5, 2007
Messages
24
i want to create a macro to filter a list of raw data that i have.

some sample data,

column A (date)
05/31/07
06/05/07
05/27/07
06/11/07

Column B (Group)
A
B
C
D

lets say I want to filter to data in the month of June and are in Group B.

how would i go about this?

thanks!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

QuietRiot

Well-known Member
Joined
May 18, 2007
Messages
1,079
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
I think this can be done non-macro

does it have to be VB
 

Barry Au

New Member
Joined
Jun 5, 2007
Messages
24
i am currently doing this manually on a weekly basis.
however I'm trying to automate this process so it can be done quicker with no errors...
 

Barry Au

New Member
Joined
Jun 5, 2007
Messages
24
I took some code off a tutorial site that I googled up, and modified it a little bit. The following code does what I want, but it is extremely slow!!! perhaps its an ineffective way to code? I've tested this code on a 399row data, with columns A:X. Column C contains the dates and I'm trying to filter all rows that are in the month June.

Please advise!!!

Sub DeleteBlankRows1()
'Deletes the entire row within the selection if the ENTIRE row contains no data.

'We use Long in case they have over 32,767 rows selected.
Dim i As Long

'We turn off calculation and screenupdating to speed up the macro.
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False

'We work backwards because we are deleting rows.
For i = Selection.Rows.Count To 2 Step -1
If Month(Cells(i, 3)) <> 6 Then
Selection.Rows(i).EntireRow.Delete
End If
Next i

.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
 

Forum statistics

Threads
1,181,102
Messages
5,928,073
Members
436,587
Latest member
Slicesofquince

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
Top