Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VBA Help, just a quicky [modified]

VBA Help, just a quicky [modified]

Scheduled Pinned Locked Moved Visual Basic
toolshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    harveyhanson
    wrote on last edited by
    #1

    All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008. So e.g. If E1 contains 2008 delete row 1 If E2 does not contain 2008 keep this row (row 2) If E3 contains 2008 delete row 3 Continue until no more values How would I do this please? I have tried to do it using in built features on Excel but i can only find and replace...etc and the macro recording isnt really helping much hense why i am asking for your help. Thanks:confused:

    modified on Tuesday, May 13, 2008 5:23 AM

    C 1 Reply Last reply
    0
    • H harveyhanson

      All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008. So e.g. If E1 contains 2008 delete row 1 If E2 does not contain 2008 keep this row (row 2) If E3 contains 2008 delete row 3 Continue until no more values How would I do this please? I have tried to do it using in built features on Excel but i can only find and replace...etc and the macro recording isnt really helping much hense why i am asking for your help. Thanks:confused:

      modified on Tuesday, May 13, 2008 5:23 AM

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      harveyhanson wrote:

      All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008. So e.g. If E1 contains 2008 delete row 1 If E2 does not contain 2008 keep this row (row 2) If E3 contains 2008 delete row 3 Continue until no more values

      The Rows collection of the worksheet has a Delete function which you can use to delete an entire row. For example: ActiveSheet.Rows(1).Delete will delete row 1. HTH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups