ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to find date format in a cell and delete that entire row (https://www.excelbanter.com/excel-programming/296844-macro-find-date-format-cell-delete-entire-row.html)

vikram

macro to find date format in a cell and delete that entire row
 
macro to find date format in a cell and delete that entire row

i have dates in a column and date keeps changing, i want that if
macro find date in a column , it deletes that entire row

help me
thank u so much everyone for ue hel

--
Message posted from http://www.ExcelForum.com


yogendra joshi

macro to find date format in a cell and delete that entire row
 
Hi,

This matches to your EXACT requirement
================================================== ======
Sub del_date_col()
Dim rng, cel As Range

For Each cel In UsedRange
If IsDate(cel) Then cel.EntireColumn.Delete
Next
End Sub
================================================== ======

but not sure if thats exactly what you want....

The above code will delete the entire column in the used range,
whenever it finds that there is a valid "Date" in that field

Hope this helps

vikram < wrote:

macro to find date format in a cell and delete that entire row

i have dates in a column and date keeps changing, i want that if a
macro find date in a column , it deletes that entire row

help me
thank u so much everyone for ue help


---
Message posted from http://www.ExcelForum.com/



Bob Phillips[_6_]

macro to find date format in a cell and delete that entire row
 
Assuming you mean specific date

Dim oFound As Range

Set oFound = Columns("A:A").Find(DateValue("2004-05-13"))
If Not oFound Is Nothing Then
oFound.EntireRow.Delete
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"vikram " wrote in message
...
macro to find date format in a cell and delete that entire row

i have dates in a column and date keeps changing, i want that if a
macro find date in a column , it deletes that entire row

help me
thank u so much everyone for ue help


---
Message posted from http://www.ExcelForum.com/




vikram

macro to find date format in a cell and delete that entire row
 
sir,

the date keeps changing

thank u so much for ur help
please tell if date keeps changing in cell

--
Message posted from http://www.ExcelForum.com


vikram

macro to find date format in a cell and delete that entire row
 
yes, the problem is that the macro provided by mr joshi is not workin
and it gives code error on "For Each cel In UsedRange"


please suggest
thank u all so muc

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

macro to find date format in a cell and delete that entire row
 
That is because UsedRange is a property of an object, and the object is not
specified. Also that solution deletes the column when you asked for row.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"vikram " wrote in message
...
yes, the problem is that the macro provided by mr joshi is not working
and it gives code error on "For Each cel In UsedRange"


please suggest
thank u all so much


---
Message posted from http://www.ExcelForum.com/




vikram

macro to find date format in a cell and delete that entire row
 
so wht do u suggest
can uhelp me ou

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

macro to find date format in a cell and delete that entire row
 
Sorry, I don't understand what you need. What was wrong with my earlier
suggestion?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"vikram " wrote in message
...
so wht do u suggest
can uhelp me out


---
Message posted from http://www.ExcelForum.com/




JWolf

macro to find date format in a cell and delete that entire row
 
Sub test()
'Macro finds and deletes all rows with
'a date in column A which
'equals a test date in cell B1
Dim DateFound As Range
Dim DFyes As Integer
Do
Set DateFound = Columns("A:A").Find(Range("B1").Value)
If Not DateFound Is Nothing Then
DFyes = 1
DateFound.EntireRow.Delete
Else
DFyes = 0
End If
Loop Until DFyes = 0
End Sub


vikram < wrote:

macro to find date format in a cell and delete that entire row

i have dates in a column and date keeps changing, i want that if a
macro find date in a column , it deletes that entire row

help me
thank u so much everyone for ue help


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com