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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I think this can be done non-macro

does it have to be VB
 
Upvote 0
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...
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,998
Members
448,541
Latest member
iparraguirre89

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