Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Problem with using dates entered via UserForm

I'm trying to create a date range in Excel in a column on
a worksheet I use a userform to enter a start and end
date, using control source for the userform fields to put
the dates in a worksheet (in cell A2 and a cell called
A1Enddate respectively on the AutumnHT1 workshet).

I execute the following code when they hit the FINISH
button on the userform:

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 15/04/2004 by blcutler
'
Sheets("AutumnHT1").Select

Range("A2").Select

Selection.DataSeries Rowcol:=xlColumns,
Type:=xlChronological, Date:= _
xlWeekday, Step:=1, Stop:=Range("A1Enddate"), Trend:=False

End Sub


I get the following error:

Run time error 1004

DataSeries method of range class failed

Any ideas of what may be happening? There is defintely
data put in the cells (A2 and A1Enddate) on AutumnHT1 by
the userform. The Userform executes on a different sheet
hence the Sheets("AutumnHT1").Select

The macro works if I enter dates directly into the cells
and then run it rather than using a userform.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Problem with using dates entered via UserForm

And you have a few responses to your other posts.

Brian C wrote:

I'm trying to create a date range in Excel in a column on
a worksheet I use a userform to enter a start and end
date, using control source for the userform fields to put
the dates in a worksheet (in cell A2 and a cell called
A1Enddate respectively on the AutumnHT1 workshet).

I execute the following code when they hit the FINISH
button on the userform:

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 15/04/2004 by blcutler
'
Sheets("AutumnHT1").Select

Range("A2").Select

Selection.DataSeries Rowcol:=xlColumns,
Type:=xlChronological, Date:= _
xlWeekday, Step:=1, Stop:=Range("A1Enddate"), Trend:=False

End Sub

I get the following error:

Run time error 1004

DataSeries method of range class failed

Any ideas of what may be happening? There is defintely
data put in the cells (A2 and A1Enddate) on AutumnHT1 by
the userform. The Userform executes on a different sheet
hence the Sheets("AutumnHT1").Select

The macro works if I enter dates directly into the cells
and then run it rather than using a userform.


--

Dave Peterson

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
Need help with 52 worksheets that need dates entered Susan Excel Discussion (Misc queries) 2 September 24th 09 07:53 PM
Loop based on number entered in userform Richhall[_2_] Excel Worksheet Functions 1 September 17th 09 03:58 PM
Dates not entered correctly Stealth_scorpio Excel Discussion (Misc queries) 6 October 13th 08 02:32 PM
how can i re-populate a userform with data already entered? Paul Dye New Users to Excel 1 January 24th 07 04:49 AM
Validating Dates Entered patam Excel Discussion (Misc queries) 2 September 2nd 05 05:36 PM


All times are GMT +1. The time now is 01:43 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"