Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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?






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Incorporation Frustration (sorry for the re-post) Danny Boy Excel Worksheet Functions 4 July 5th 09 06:08 PM
Re-post: Code to make sheet very hidden based on date wx4usa Excel Discussion (Misc queries) 1 December 30th 08 06:19 AM
3 months prior and 3 months post a date renee Excel Worksheet Functions 2 May 2nd 08 05:46 PM
This is my Third Post Please Help !!!!!! Need help with sumif Excel Discussion (Misc queries) 5 April 8th 06 05:16 PM
Should I generally request "post a poll" when I post a new thread? Joe Miller Excel Discussion (Misc queries) 2 January 7th 06 04:46 PM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"