![]() |
How do I post the date?
In VBA EXcel, I have a report that will list data. The number of records will
be different everytime I run the report. I want to add a column at the end of the report to show today's date. How do I do this to correspond with the number of records? |
How do I post the date?
Hi,
supposing, that last column with data is "D", you can use: dim rng as range rng=range("D" & application.Rows.Count).End(xlUp).Offset(0,1) rng is the range in column just next to D, in the last used row. Regards, Ivan |
How do I post the date?
try this idea. Change activecell.row to suit your code
Sub dateinlastcol() Cells(ActiveCell.Row, Columns.Count) _ ..End(xlToLeft).Offset(, 1) = Date End Sub -- Don Guillett SalesAid Software "marthasanchez" wrote in message ... In VBA EXcel, I have a report that will list data. The number of records will be different everytime I run the report. I want to add a column at the end of the report to show today's date. How do I do this to correspond with the number of records? |
How do I post the date?
Hi Martha,
I may be over simplifying here, but couldn't you just put &[date] in the footer rather than part of your VBA routine. Just a thought Martin |
How do I post the date?
Then how do i get it to do the function?
"Ivan Raiminius" wrote: Hi, supposing, that last column with data is "D", you can use: dim rng as range rng=range("D" & application.Rows.Count).End(xlUp).Offset(0,1) rng is the range in column just next to D, in the last used row. Regards, Ivan |
How do I post the date?
I need to add it as a column in a date format so that I may calculate the
dates on the report "MartinW" wrote: Hi Martha, I may be over simplifying here, but couldn't you just put &[date] in the footer rather than part of your VBA routine. Just a thought Martin |
How do I post the date?
I did exactly the formula below and this mehtod did noe wor?
"Don Guillett" wrote: try this idea. Change activecell.row to suit your code Sub dateinlastcol() Cells(ActiveCell.Row, Columns.Count) _ ..End(xlToLeft).Offset(, 1) = Date End Sub -- Don Guillett SalesAid Software "marthasanchez" wrote in message ... In VBA EXcel, I have a report that will list data. The number of records will be different everytime I run the report. I want to add a column at the end of the report to show today's date. How do I do this to correspond with the number of records? |
All times are GMT +1. The time now is 01:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com