ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Function in VBA??? (https://www.excelbanter.com/excel-programming/313342-date-function-vba.html)

Michael Vaughan

Date Function in VBA???
 
Hello Everyone,

The book that I have is NOT very descriptive when it comes to time/date
functions. When looking for a date using a regular formula, I can get the
date by using: DAY(L2). What is the VBA equivalent to that??? I want to
look at a cell and look at the day. If the date in lets say cell A1 is
10/04/04, then I want to insert a row to make it 10/01/04. Plus, I would
like to insert more rows leading up to the date of 10/04/04. So, it would
look like this:

10/01/04 This would be inserted by VBA
10/02/04 This would be inserted by VBA
10/03/04 This would be inserted by VBA
10/04/04 This was the original date in cell A1.

Any help would be appreciated... mv



Bob Phillips[_6_]

Date Function in VBA???
 
Day(Range("A1").Value)

--

HTH

RP

"Michael Vaughan" wrote in message
...
Hello Everyone,

The book that I have is NOT very descriptive when it comes to time/date
functions. When looking for a date using a regular formula, I can get the
date by using: DAY(L2). What is the VBA equivalent to that??? I want to
look at a cell and look at the day. If the date in lets say cell A1 is
10/04/04, then I want to insert a row to make it 10/01/04. Plus, I would
like to insert more rows leading up to the date of 10/04/04. So, it would
look like this:

10/01/04 This would be inserted by VBA
10/02/04 This would be inserted by VBA
10/03/04 This would be inserted by VBA
10/04/04 This was the original date in cell A1.

Any help would be appreciated... mv





Tom Ogilvy

Date Function in VBA???
 
Activecell.Resize(Day(ActiveCell-1),1).EntireRow.Insert

--
Regards,
Tom Ogilvy

"Michael Vaughan" wrote in message
...
Hello Everyone,

The book that I have is NOT very descriptive when it comes to time/date
functions. When looking for a date using a regular formula, I can get the
date by using: DAY(L2). What is the VBA equivalent to that??? I want to
look at a cell and look at the day. If the date in lets say cell A1 is
10/04/04, then I want to insert a row to make it 10/01/04. Plus, I would
like to insert more rows leading up to the date of 10/04/04. So, it would
look like this:

10/01/04 This would be inserted by VBA
10/02/04 This would be inserted by VBA
10/03/04 This would be inserted by VBA
10/04/04 This was the original date in cell A1.

Any help would be appreciated... mv





Tom Ogilvy

Date Function in VBA???
 
Activecell.Resize(Day(ActiveCell-1),1).EntireRow.Insert


"Michael Vaughan" wrote in message
...
Hello Everyone,

The book that I have is NOT very descriptive when it comes to time/date
functions. When looking for a date using a regular formula, I can get the
date by using: DAY(L2). What is the VBA equivalent to that??? I want to
look at a cell and look at the day. If the date in lets say cell A1 is
10/04/04, then I want to insert a row to make it 10/01/04. Plus, I would
like to insert more rows leading up to the date of 10/04/04. So, it would
look like this:

10/01/04 This would be inserted by VBA
10/02/04 This would be inserted by VBA
10/03/04 This would be inserted by VBA
10/04/04 This was the original date in cell A1.

Any help would be appreciated... mv






All times are GMT +1. The time now is 05:15 AM.

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