Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I know how to use If, Then, Else command

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
For eg, I want to
If WoodType="mahogany" then
....
is this the correct way to compare string
 
you can StrComp for strings. Watch out for case e.g.
"mahogany" not = "Mahogany"
if LCase$(strWoodType) = "mahogany"
if 0 = Strcomp(strWoodType,"mahogany",vbTectCompare) ' case insensitive

Yes, Lcase$, Left$, Right$ etc are faster rhan LCase, Left, Right etc.
 
In general:

If WoodType="mahogany" then
msgBox("good match")
else
msgBox("no match")
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top