#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default input box

I want to use a date input into an input box. Every syntax combination I try
refused by compiler. Help please?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default input box

Is this what you want?

'Put the value of A1 in TextBox1 on UserForm1
UserForm1.TextBox1.Text = Range("A1")
'Open Userform1
UserForm1.Show

--
Ronald Ferdinandus
http://www.ro-pay.nl


"Matilda" wrote:

I want to use a date input into an input box. Every syntax combination I try
refused by compiler. Help please?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default input box

Hi Ronald - I'm so glad you're still up on a Sunday (as it is here) and
helping out newbies :-)

I want user to input desired date into inputBox, then I want to use that
date to access a range of associated data.

I have columns of data stored under date headings. With your lovely little
routine I can now move through the column and get out the data I want and put
it into a print area.

I hope I have explained myself better,

Ta muchly

"RonaldF" wrote:

Is this what you want?

'Put the value of A1 in TextBox1 on UserForm1
UserForm1.TextBox1.Text = Range("A1")
'Open Userform1
UserForm1.Show

--
Ronald Ferdinandus
http://www.ro-pay.nl


"Matilda" wrote:

I want to use a date input into an input box. Every syntax combination I try
refused by compiler. Help please?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default input box

Dim dt as Date, res as Variant
Dim res1 as Variant
res = InputBox("Please enter the date")
if isdate(res) then
dt = Cdate(res)
res1 = Application.Match(clng(dt),Rows(1),0)
if not iserror(res1) then
msgbox format(dt,"mmm dd, yyyy") & _
" found at column " & res1
else
msgbox format(dt,"mmm dd, yyyy") & _
" not found"
end if
Else
Msgbox res & " is not a date"
End if

--
Regards,
Tom Ogilvy


"Matilda" wrote in message
...
Hi Ronald - I'm so glad you're still up on a Sunday (as it is here) and
helping out newbies :-)

I want user to input desired date into inputBox, then I want to use that
date to access a range of associated data.

I have columns of data stored under date headings. With your lovely little
routine I can now move through the column and get out the data I want and

put
it into a print area.

I hope I have explained myself better,

Ta muchly

"RonaldF" wrote:

Is this what you want?

'Put the value of A1 in TextBox1 on UserForm1
UserForm1.TextBox1.Text = Range("A1")
'Open Userform1
UserForm1.Show

--
Ronald Ferdinandus
http://www.ro-pay.nl


"Matilda" wrote:

I want to use a date input into an input box. Every syntax

combination I try
refused by compiler. Help please?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default input box

Tom,
Your elegant code works a dream, thankyou.

Matilda

"Tom Ogilvy" wrote:

Dim dt as Date, res as Variant
Dim res1 as Variant
res = InputBox("Please enter the date")
if isdate(res) then
dt = Cdate(res)
res1 = Application.Match(clng(dt),Rows(1),0)
if not iserror(res1) then
msgbox format(dt,"mmm dd, yyyy") & _
" found at column " & res1
else
msgbox format(dt,"mmm dd, yyyy") & _
" not found"
end if
Else
Msgbox res & " is not a date"
End if

--
Regards,
Tom Ogilvy


"Matilda" wrote in message
...
Hi Ronald - I'm so glad you're still up on a Sunday (as it is here) and
helping out newbies :-)

I want user to input desired date into inputBox, then I want to use that
date to access a range of associated data.

I have columns of data stored under date headings. With your lovely little
routine I can now move through the column and get out the data I want and

put
it into a print area.

I hope I have explained myself better,

Ta muchly

"RonaldF" wrote:

Is this what you want?

'Put the value of A1 in TextBox1 on UserForm1
UserForm1.TextBox1.Text = Range("A1")
'Open Userform1
UserForm1.Show

--
Ronald Ferdinandus
http://www.ro-pay.nl


"Matilda" wrote:

I want to use a date input into an input box. Every syntax

combination I try
refused by compiler. Help please?




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
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


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