Is there some vba code that will completly remove all rows after a certain date in A column, the date is in B2. Dates are listed in A column.
When i say completely remove i mean delete, clear colours, remove borders,etc etc
Thanks
Is there some vba code that will completly remove all rows after a certain date in A column, the date is in B2. Dates are listed in A column.
When i say completely remove i mean delete, clear colours, remove borders,etc etc
Thanks
Last edited by Directlinq; 03-04-2009 at 06:55 AM.
Perhaps:
Public Sub PurgeData() Range(Cells(Application.Match(CLng(Cells(2, "B")), Columns(1), 0) + 1, "A"), Cells(Rows.Count, "A")).EntireRow.Delete End Sub
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
That deletes the cells great but does not remove internal colours or boxes etc.
It deletes the rows in their entirety thus including any/all formatting on said cells.
Are you running any VBA Events to set Formatting ?
yes but this macro runs after the formatting macro has finished.
I have no idea what that means.. are you're formatting via a standard Sub Routine or via an Event ... if it's an Event (ie Worksheet_Change) then it doesn't matter what you do the Event will always fire and reformat the ranges as specified.
Rather than guessing I would suggest you actually post a sample file with code so we can see what's happening.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks