Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 149
Default Help with setting a "nof found" statement

Hi.


I have the following code:

Private Sub CommandButton1_Click()
Dim myasset As Variant
Dim Assettag As Variant
Assettag = UserForm1.TextBox1.Value


If UserForm1.TextBox1.Value 0 Then

'Serial #
Set myasset = ThisWorkbook.Sheets("Full
listing").Columns("a").Find(What:=Assettag, LookAt:=xlWhole)
UserForm1.TextBox2.Value = myasset.Offset(0, 1).Value

'Product desc

Set myasset = ThisWorkbook.Sheets("Full
listing").Columns("a").Find(What:=Assettag, LookAt:=xlWhole)
UserForm1.TextBox3.Value = myasset.Offset(0, 2).Value

'City
Set myasset = ThisWorkbook.Sheets("Full
listing").Columns("a").Find(What:=Assettag, LookAt:=xlWhole)
UserForm1.TextBox4.Value = myasset.Offset(0, 3).Value


What I need is a statement that will produce a meassage box with "asset not
found" if there is no match - can anyone help?

Thanks

Pierre
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Help with setting a "nof found" statement

Check your previous post.

Pierre wrote:

Hi.

I have the following code:

Private Sub CommandButton1_Click()
Dim myasset As Variant
Dim Assettag As Variant
Assettag = UserForm1.TextBox1.Value

If UserForm1.TextBox1.Value 0 Then

'Serial #
Set myasset = ThisWorkbook.Sheets("Full
listing").Columns("a").Find(What:=Assettag, LookAt:=xlWhole)
UserForm1.TextBox2.Value = myasset.Offset(0, 1).Value

'Product desc

Set myasset = ThisWorkbook.Sheets("Full
listing").Columns("a").Find(What:=Assettag, LookAt:=xlWhole)
UserForm1.TextBox3.Value = myasset.Offset(0, 2).Value

'City
Set myasset = ThisWorkbook.Sheets("Full
listing").Columns("a").Find(What:=Assettag, LookAt:=xlWhole)
UserForm1.TextBox4.Value = myasset.Offset(0, 3).Value

What I need is a statement that will produce a meassage box with "asset not
found" if there is no match - can anyone help?

Thanks

Pierre


--

Dave Peterson
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
Help with setting a "not found" statement Pierre Excel Discussion (Misc queries) 2 April 21st 10 02:53 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
how do I turn on document "editing time" found on advanced proper. cancer711 Excel Discussion (Misc queries) 2 May 24th 08 02:52 PM
"No RETURN() or HALT() function found on macro sheet." Will Excel Worksheet Functions 2 January 4th 07 10:10 PM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM


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