Go Back   Cyber Tech Help Support Forums > Software > Applications

Notices

Reply
 
Topic Tools
  #1  
Old October 29th, 2007, 05:49 PM
Cryos Cryos is offline
New Member
 
Join Date: Oct 2007
Posts: 1
Thumbs up Excel (Office) 2003::vba date

hey.guys.. I'm currently making this excel database. I have a list of dates and I wanna know and keep todays date, and...delete the rows of the dates before todays'. I'm trying to use VBA/micros to do this. I'm trying to keep past dates like yesterdays.

Today is 10/29/2007..when tomorrow comes all I would have to do is open the excel sheet and, the file would be updated automaticly. Its my first time programming in excel.


:ont laugh , but here is my code::


Public Sub main()
Range("A1").Select
ActiveCell.Value = Now

Gooda = ActiveCell.Value = Now

Goodb = ActiveCell.FormulaR1C1 = "Created"

Goodc = ActiveCell.FormulaR1C1 = ""

If Range("H1") = Goodb Or Goodc Then Range("H1").Select
If Range("H1") = Now + 1 Then Range("H1").Select.EntireRow.Delete

If Range("H2") = Goodb Or Goodc Then Range("H2").Select
If Range("H2") = Now + 1 Then Range("H3").EntireRow.Delete

If Range("H3") = Goodb Or Goodc Then Range("H3").Select
If Range("H3") = Now + 1 Then Range("H5").EntireRow.Delete

If Range("H4") = Goodb Or Goodc Then Range("H4").Select
If Range("H4") = Now + 1 Then Range("H6").EntireRow.Delete

If Range("H5") = Goodb Or Goodc Then Range("H5").Select
If Range("H5") = Now + 1 Then Range("H6").EntireRow.Delete

If Range("H6") = Goodb Or Goodc Then Range("H7").Select
If Range("H6") = Now + 1 Then Range("H8").EntireRow.Delete

If Range("H7") = Goodb Or Goodc Then Range("H8").Select
If Range("H7") = Now + 1 Then Selection.EntireRow.Delete

If Range("H8") = Goodb Or Goodc Then Range("H9").Select
If Range("H8") = Now + 1 Then Selection.EntireRow.Delete

If Range("H9") = Goodb Or Goodc Then Range("H10").Select
If Range("H9") = Now + 1 Then Selection.EntireRow.Delete

If Range("H10") = Goodb Or Goodc Then Range("H11").Select
If Range("H10") = Now + 1 Then Selection.EntireRow.Delete


End Sub
Reply With Quote
  #2  
Old October 30th, 2007, 10:03 AM
oracle128's Avatar
oracle128 oracle128 is offline
Α Ω
 
Join Date: Oct 2000
O/S: Windows XP Pro
Location: Melbourne, Australia
Age: 24
Posts: 9,401
What is the purpose of this project? If it's homework, I'm limited as to how much I can help. If it's not, I'd be recommending MS Access or OO.org Base, since Excel is a spreadsheet program, not a database.
__________________
Oracle's backup tutorial

"A lot of people say games are addictive. Well, they're addictive in the sense that anything you like doing you repeat endlessly. But no one would say, 'Mr Kasparov, you have a chess problem,' or 'Tiger Woods, you have a golf addiction.'" - Ian Livingstone, Creative Director, Eidos.

"A problem well stated is a problem half solved" - Charles Franklin Kettering
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:39 AM.

[ RSS ]