Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I've been driving myself crazy trying to figure this out! I have a spreadsheet with a huge range of garbage cells, and I just need to extract the cells in a specific date format. IE: 1991 - 1995. A string of 11 characters (including spaces).
I am looking to delete all cells that do not fit that format and remove all blank cells. Any help on this is greatly appeciated! Thanks! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
Lets assume your sheet is the following: mySht is the Name of your Sheet myRng is the Range of the column that the code has to run down myVal is the Date string match that you want to find in myRng c represents every Cell within myRng Change the above to fit the code below. Sub RemoveGarbage() Dim mySht As Worksheet Dim myRng As Range Dim myVal As Range Dim c As Range Set mySht = Sheets("Sheet1") Set myRng = mySht.Range("F2:F10") Set myVal = [F1] For Each c In myRng If Not c < myVal Then With c .EntireRow.Delete xlUp End With End If Next c End Sub HTH Mick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete specific range of cells if containing "0" | Excel Programming | |||
Convert 1934 minutes into 32Hour 14Minutes | Excel Worksheet Functions | |||
Multiple "Range" with "Cells" property? | Excel Programming | |||
Multiple "Range" with "Cells" property? | Excel Programming | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |