Visual Basic for Excel

CESCOBAR

New Member
Joined
Jun 8, 2015
Messages
4
I have a series of swipe card "beeps" in excel 2010 for the month of april. They are sorted by date per each employee. There are multiple "beeps" per day since the employees go from the production floor to the cafeteria, home, or to the restroom

I need to device a macro where I can calculate the time outside of the production floor that each employee takes. I'm having problems with Visual Basic since I do not know how to tell visual basic to select a range that I need to delete after filtering. This range shows directly under the filtering header after filtering; however, in cell referencing related terms there are more rows in between but are hidden due to filtering.

I need to know how to select this range and delete it after each filter (because I need to filter many times by different dates) without assigning a cell reference like (G24:J24) since this will change month to month.

Thank you.
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Maybe a revised range version along with the .SpecialCells(xlCellTypeVisible) cells can do the trick for you.

Delete or clear...?

Howard

Code:
For Each cell In Range("A2", Range("A2").End(xlDown)).SpecialCells(xlCellTypeVisible)
cell.EntireRow.Delete
'cell.ClearContents
Next
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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