Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Macro Prompting

I created an Excel macro to update a worksheet on a monthly basis. The macro
prompts for the Start and Stop dates using the InputBox Method. The problem
I'm having is that the date values will not occupy the designated cells. The
following is what I created:

Dim dtestart As Date
dtestart = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b6").Formula = "dtestart"

Dim dtestop As Date
dtestop = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b7").Formula = "dtestop"

Instead of the dates being input into cells b6 and b7, the strings
"dtestart" and "dtestop" are entered.

Please help! The date (example: 05/31/2008 ) needs to occupy the cell
after it is input.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Excel Macro Prompting

Remove the quotes around the variable names
..Formula = dtestart

HTH. Best wishes Harald

"crusse04" wrote in message
...
I created an Excel macro to update a worksheet on a monthly basis. The
macro
prompts for the Start and Stop dates using the InputBox Method. The
problem
I'm having is that the date values will not occupy the designated cells.
The
following is what I created:

Dim dtestart As Date
dtestart = InputBox("ENTER START DATE FOR THIS CDRL PERIOD:
MM/DD/YYYY")
Worksheets("Configuration").Range("b6").Formula = "dtestart"

Dim dtestop As Date
dtestop = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b7").Formula = "dtestop"

Instead of the dates being input into cells b6 and b7, the strings
"dtestart" and "dtestop" are entered.

Please help! The date (example: 05/31/2008 ) needs to occupy the cell
after it is input.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Excel Macro Prompting

Remove the quotes...

Dim dtestart As Date
dtestart = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b6").Formula = dtestart

Dim dtestop As Date
dtestop = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b7").Formula = dtestop

--
HTH...

Jim Thomlinson


"crusse04" wrote:

I created an Excel macro to update a worksheet on a monthly basis. The macro
prompts for the Start and Stop dates using the InputBox Method. The problem
I'm having is that the date values will not occupy the designated cells. The
following is what I created:

Dim dtestart As Date
dtestart = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b6").Formula = "dtestart"

Dim dtestop As Date
dtestop = InputBox("ENTER START DATE FOR THIS CDRL PERIOD: MM/DD/YYYY")
Worksheets("Configuration").Range("b7").Formula = "dtestop"

Instead of the dates being input into cells b6 and b7, the strings
"dtestart" and "dtestop" are entered.

Please help! The date (example: 05/31/2008 ) needs to occupy the cell
after it is input.

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
Macro Examples for prompting info Patches Excel Programming 1 May 9th 07 07:25 PM
Save file without prompting in Excel Macro [email protected] Excel Programming 2 November 16th 06 04:01 PM
Excel Macro Save CSV Cell without Prompting [email protected] Excel Discussion (Misc queries) 1 November 16th 06 03:59 PM
Prompting 'Save As' in an Excel Macro Glenn Gooding Excel Programming 1 December 2nd 04 09:49 AM
Prompting a macro to run on change of cell content NuclearWookiee Excel Programming 11 April 15th 04 06:37 PM


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