Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default need advice on 0, "" , " "

Hi All,

I do not know what is the best way for the below syntax. Any better function
instead of using 0, "" or " " although it can work. Now I afraid if user
enter " " which is 2 spaces then the program unable to detect.
Need the advice.
Thanks

If qty = 0 Or qty = " " Or qty = "" _
Or item = " " Or item = "" Then
MsgBox ("Part Number and Quantity Must Input!")
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 644
Default need advice on 0, "" , " "

you can use this to detect a variable amount of spaces.
if qty = Space(Len(qty))
is your part number all numeric? is there a way you can check a list to
see if it matches and return an error if it doesn't?

HTH

Die_Another_Day
AskExcel wrote:
Hi All,

I do not know what is the best way for the below syntax. Any better function
instead of using 0, "" or " " although it can work. Now I afraid if user
enter " " which is 2 spaces then the program unable to detect.
Need the advice.
Thanks

If qty = 0 Or qty = " " Or qty = "" _
Or item = " " Or item = "" Then
MsgBox ("Part Number and Quantity Must Input!")


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default need advice on 0, "" , " "

Hello,

I suggest you could use function TRIM(text). TRIM() could get rid of the
space on both sides and keep one space between two words.If you define
variable as string, you can do as follows:

if trim(qty)="" or trim(qty) = "0" then
....

Hope it works!

Viesta
Shanghai, CN

"AskExcel" wrote:

Hi All,

I do not know what is the best way for the below syntax. Any better function
instead of using 0, "" or " " although it can work. Now I afraid if user
enter " " which is 2 spaces then the program unable to detect.
Need the advice.
Thanks

If qty = 0 Or qty = " " Or qty = "" _
Or item = " " Or item = "" Then
MsgBox ("Part Number and Quantity Must 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
Spell check: advise and advice are used in the wrong context. Fussy Lady Excel Discussion (Misc queries) 1 March 28th 06 04:23 PM
Advice on how to automate [email protected] Links and Linking in Excel 0 March 15th 06 07:05 PM
Importing data, and need formatting advice Bob in Charlotte Excel Worksheet Functions 8 December 24th 05 04:56 PM
Excel Application Development Costs - Need Advice TheRobsterUK Excel Discussion (Misc queries) 2 June 3rd 05 08:23 PM
building invoice - strategy advice Excel Discussion (Misc queries) 0 January 3rd 05 01:29 PM


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