Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
input box
I want to use a date input into an input box. Every syntax combination I try
refused by compiler. Help please? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF | Excel Worksheet Functions | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |