简体   繁体   中英

Excel VBA - Delete rows when a cell contains a date

I am trying to write code that does the following:

  • Finds Cell A4.
  • If cell contains a date, delete the entire row.
  • I want this to loop until the cell in column A does not contain a date. Once the cell is blank, the loop can end.

Here's all you need to do this:

  • Using the VBA function IsDate
  • If the value returned is true on the value in Range A4
  • Delete entire row of Range A4
  • If not then your sub is over.

Really it should not be much longer than 5-9 lines of code and it's all very very very simple. Come back if you have trouble writing the code and ask a specific question about what you are having trouble with .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM