|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Bookmarks |
«
Previous Topic
|
Next Topic
»
| Topic Tools | |
|
|
All times are GMT +1. The time now is 01:39 AM.
[
RSS ]



ont laugh 




