Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Posts: 84
Default Auto populate date VBA code

Is there a code that allows a date to be entered and succesive dates to populate?

Right now I have a date in B9 and in B10 I have "=B9+1" which is copied down the column to complete 365 days.

My concern is an inerrant click could delete the formula(s) and disrupt the sequence.

Thanks in advance for the help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Auto populate date VBA code

Hi,

Am Wed, 23 Jan 2013 19:24:31 +0000 schrieb Keyrookie:

Is there a code that allows a date to be entered and succesive dates to
populate?


have you tried Start = Edit = Fill = Fill Series = Columns = Linear
= Step Value = 1 = Stop value = 12/31/2013


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Auto populate date VBA code

Hi again,

Am Wed, 23 Jan 2013 20:53:05 +0100 schrieb Claus Busch:

have you tried Start = Edit = Fill = Fill Series = Columns = Linear
= Step Value = 1 = Stop value = 12/31/2013


sorry, but not Linear. Choose Date


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Member
 
Posts: 84
Default

Claus,
I copied this code exactly as you have it and inserted a date but nothing happened. I then substituted "Linear" for "Choose Date" and still nothing. Am I missing something?

Quote:
Originally Posted by Claus Busch View Post
Hi again,

Am Wed, 23 Jan 2013 20:53:05 +0100 schrieb Claus Busch:

have you tried Start = Edit = Fill = Fill Series = Columns = Linear
= Step Value = 1 = Stop value = 12/31/2013


sorry, but not Linear. Choose Date


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Auto populate date VBA code

Hi,

Am Thu, 24 Jan 2013 14:48:19 +0000 schrieb Keyrookie:

I copied this code exactly as you have it and inserted a date but
nothing happened. I then substituted "Linear" for "Choose Date" and
still nothing. Am I missing something?


that's no code. That is a step by step guidance to do it in Excel.
Enter the start date e.g. in A1 and follow the steps.


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Auto populate date VBA code

Hi,

Am Thu, 24 Jan 2013 14:48:19 +0000 schrieb Keyrookie:

I copied this code exactly as you have it and inserted a date but
nothing happened. I then substituted "Linear" for "Choose Date" and
still nothing. Am I missing something?


if you want to do it with VBA then try (modify to suit):

Sub Test()
Dim StopVal As Long
Dim myYear As Integer

myYear = 2013
StopVal = DateSerial(myYear, 12, 31)
[A1] = DateSerial(myYear, 1, 1)
Range("A1").DataSeries Rowcol:=xlColumns, _
Type:=xlChronological, Date:=xlDay, Step:=1, _
Stop:=StopVal, Trend:=False
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #7   Report Post  
Member
 
Posts: 84
Default

Claus,

Thank you for your help, however I still can't get it to work. I copied the VBA code you gave and nothing happened. I then tried modifications with no results.

Since the VBA code shows the Range as A1, I entered 2013-1-1 in A1 expecting the column to populate with succesive dates. It did not happen. I then entered data into column B thinking the code needed adjacent data to activate, yet nothing happened.

Apparantly I'm missing something so could you please guide me, step by step, through the process?

Quote:
Originally Posted by Claus Busch View Post
Hi,

Am Thu, 24 Jan 2013 14:48:19 +0000 schrieb Keyrookie:

I copied this code exactly as you have it and inserted a date but
nothing happened. I then substituted "Linear" for "Choose Date" and
still nothing. Am I missing something?


if you want to do it with VBA then try (modify to suit):

Sub Test()
Dim StopVal As Long
Dim myYear As Integer

myYear = 2013
StopVal = DateSerial(myYear, 12, 31)
[A1] = DateSerial(myYear, 1, 1)
Range("A1").DataSeries Rowcol:=xlColumns, _
Type:=xlChronological, Date:=xlDay, Step:=1, _
Stop:=StopVal, Trend:=False
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Auto populate date VBA code

Hi,

Am Fri, 25 Jan 2013 14:28:00 +0000 schrieb Keyrookie:

Apparantly I'm missing something so could you please guide me, step by
step, through the process?


in your workbook press Alt+F11. In VBA-Editor choose Insert = Module.
Copy the code into the code module. Back in Excel = View = View
Macros. Choose the macro by name and rund the macro.


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
Formula to auto-populate with current date Bill-Ace Excel Discussion (Misc queries) 1 June 26th 09 02:58 PM
How to Auto populate dates from a given start date Jim Hammerel Excel Programming 2 June 14th 08 09:29 AM
how do you auto populate the date in excel? ccb/ws New Users to Excel 2 June 13th 06 07:46 PM
timesheet auto populate date? ll Excel Programming 1 May 22nd 06 03:52 PM
HOW ?Excel chart auto insert /populate a code based on date MikeR-Oz New Users to Excel 6 December 22nd 05 12:16 PM


All times are GMT +1. The time now is 09:54 PM.

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"