LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default formatting input boxes


Hi, i have a piece of code that is basically a means for users to copy
raw data out of external spreadsheets into another spreadsheet for
analysis and manipulation.

The raw data has a column on left that declares year and quarter in
format of 2005Q4. The user is faced with an inputbox that prompts them
for the date to copy data until. If they make a mistake e.g 200Q4,
200404 2005Q5 then the code is going to break. I would therfore like
some validation on the input box that verifys that we have a date in
the correct format that can be searched for.

Something like

sYear = Application.InputBox("Which Year/Quarter should data be
returned until? (In the format of 2006Q4)?", "Select Date", "2005Q4")

if syear = integer,integer,integer,integer,char,integer then

elseif syear = "" then
""No value"
end sub
end if

if left(syear,4) 1990 and < 2010 then
else
exit sub
end if

if right(syear,1) in < 1 or 2 or 3 or 4
exit sub
end if


Is this along the right lines or am i taking a very long way round?


--
cereldine
------------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=552603

 
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 boxes James Excel Discussion (Misc queries) 5 July 23rd 08 07:49 PM
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
Input Boxes carvil16[_2_] Excel Programming 2 January 20th 04 10:19 PM
Can anyone help with input boxes? index[_10_] Excel Programming 3 December 6th 03 12:23 AM
Mask input in input boxes? Eric[_14_] Excel Programming 4 November 29th 03 11:10 AM


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