Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Filling in today's date against every record

Hi All,

I have a spreadsheet that will contain varying amounts of data (lets say
between 20,000 and 40,000) records. I have created a macro that will sort
this data into a specific format. Now i want to just put todays data against
every record. (So basically i want "=today()" all down column A.) I also
dont want more than I need. So if i have 20,000 records I only want 20,000
dates pasted in.

I have tried using "record a macro" whilst recording I use:
"end + down arrow" to find the last record then shift accross to the left,
then
"shift + end + up arrow" Then pasting in the date. However record a macro,
just fills in the cells A1:A20000. So if I then have a sheet with 30,000
records im missing a lot of dates.

Anyone have an idea?

Thanks in advance, any help is much appreciated :)

Ernest

ps. have a good weekend
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Filling in today's date against every record

Suppose you want to "fill down" column A, but only as far as there is data in
column B

In cell A1 enter:
=IF(B1="","",TODAY())

and copy all the way down. As soon as there is no data in column B, column
A will also show blank. This way you don't need to worry about where your
records end.
--
Gary's Student
gsnu200702


"Ernest Lai" wrote:

Hi All,

I have a spreadsheet that will contain varying amounts of data (lets say
between 20,000 and 40,000) records. I have created a macro that will sort
this data into a specific format. Now i want to just put todays data against
every record. (So basically i want "=today()" all down column A.) I also
dont want more than I need. So if i have 20,000 records I only want 20,000
dates pasted in.

I have tried using "record a macro" whilst recording I use:
"end + down arrow" to find the last record then shift accross to the left,
then
"shift + end + up arrow" Then pasting in the date. However record a macro,
just fills in the cells A1:A20000. So if I then have a sheet with 30,000
records im missing a lot of dates.

Anyone have an idea?

Thanks in advance, any help is much appreciated :)

Ernest

ps. have a good weekend

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Filling in today's date against every record

Thanks very much :D works perfectly and explained much better haha. And I
thought Friday couldnt get any better.

thanks again.

Ernest




"Gary''s Student" wrote:

Suppose you want to "fill down" column A, but only as far as there is data in
column B

In cell A1 enter:
=IF(B1="","",TODAY())

and copy all the way down. As soon as there is no data in column B, column
A will also show blank. This way you don't need to worry about where your
records end.
--
Gary's Student
gsnu200702


"Ernest Lai" wrote:

Hi All,

I have a spreadsheet that will contain varying amounts of data (lets say
between 20,000 and 40,000) records. I have created a macro that will sort
this data into a specific format. Now i want to just put todays data against
every record. (So basically i want "=today()" all down column A.) I also
dont want more than I need. So if i have 20,000 records I only want 20,000
dates pasted in.

I have tried using "record a macro" whilst recording I use:
"end + down arrow" to find the last record then shift accross to the left,
then
"shift + end + up arrow" Then pasting in the date. However record a macro,
just fills in the cells A1:A20000. So if I then have a sheet with 30,000
records im missing a lot of dates.

Anyone have an idea?

Thanks in advance, any help is much appreciated :)

Ernest

ps. have a good weekend

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Filling in today's date against every record

Ernest

You do realize that tomorrow the =TODAY() function will update.

Here's a macro to insertcopy the date from A1 down as far as you have data in
Column B

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("B" & Rows.Count).End(xlUp).Row
Range("A1").Value = Format(Date, "mm-dd-yyyy")
'or if you want =TODAY()
'Range("A1").Formula = "=TODAY()"
Range("A1:A" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP



On Fri, 26 Jan 2007 08:21:02 -0800, Ernest Lai
wrote:

Hi All,

I have a spreadsheet that will contain varying amounts of data (lets say
between 20,000 and 40,000) records. I have created a macro that will sort
this data into a specific format. Now i want to just put todays data against
every record. (So basically i want "=today()" all down column A.) I also
dont want more than I need. So if i have 20,000 records I only want 20,000
dates pasted in.

I have tried using "record a macro" whilst recording I use:
"end + down arrow" to find the last record then shift accross to the left,
then
"shift + end + up arrow" Then pasting in the date. However record a macro,
just fills in the cells A1:A20000. So if I then have a sheet with 30,000
records im missing a lot of dates.

Anyone have an idea?

Thanks in advance, any help is much appreciated :)

Ernest

ps. have a good weekend


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Filling in today's date against every record

Ooo Thanks Gord, that actually works a lil better. As I import the file
into access afterwards and now i dont get the import errors (which didnt
really matter as its not in the same table as the data)

Yes I am aware Today() updates I did a macro to special paste the values
afterwards but I guess that wasnt very efficient ;)

Thanks again.




"Gord Dibben" wrote:

Ernest

You do realize that tomorrow the =TODAY() function will update.

Here's a macro to insertcopy the date from A1 down as far as you have data in
Column B

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("B" & Rows.Count).End(xlUp).Row
Range("A1").Value = Format(Date, "mm-dd-yyyy")
'or if you want =TODAY()
'Range("A1").Formula = "=TODAY()"
Range("A1:A" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP



On Fri, 26 Jan 2007 08:21:02 -0800, Ernest Lai
wrote:

Hi All,

I have a spreadsheet that will contain varying amounts of data (lets say
between 20,000 and 40,000) records. I have created a macro that will sort
this data into a specific format. Now i want to just put todays data against
every record. (So basically i want "=today()" all down column A.) I also
dont want more than I need. So if i have 20,000 records I only want 20,000
dates pasted in.

I have tried using "record a macro" whilst recording I use:
"end + down arrow" to find the last record then shift accross to the left,
then
"shift + end + up arrow" Then pasting in the date. However record a macro,
just fills in the cells A1:A20000. So if I then have a sheet with 30,000
records im missing a lot of dates.

Anyone have an idea?

Thanks in advance, any help is much appreciated :)

Ernest

ps. have a good weekend



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
How can I count a record if it contains a date within a date range hile trotman Excel Worksheet Functions 0 September 20th 06 08:58 PM
SUMIF within date range as a function of today()'s date irvine79 Excel Worksheet Functions 8 August 6th 06 05:55 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
Launch excel showing today's date Richard V Excel Discussion (Misc queries) 3 October 4th 05 04:20 PM
today's date CK Excel Worksheet Functions 2 May 18th 05 07:19 PM


All times are GMT +1. The time now is 10:27 AM.

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

About Us

"It's about Microsoft Excel"