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: 109
Default prompt a msg in loop code

I am testing a range whether a value exists or not.If does not exists prompt
a msg else give me cell address.
My code is:
Private sub CommandButton1_Click()
Dim i as integer
Rng=Cells(Sheet1.Rows.Count,"A").EndXlUp.Row
For i= 1 to Rng
If Cells(i, "A")=Me.TextBox1.Text Then
Me.TextBox2.Text=Cells(i, "B").Address
End If
Next
End Sub
I need a Msg"Value does not exists in your sheet".Where I should put line of
code to get the desired results.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200904/1

 
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
Need help with loop code confused Excel Programming 0 August 19th 06 07:04 PM
Help with better loop code Sliman Excel Programming 1 March 16th 06 07:10 PM
code to prompt before activating changes mhmaid New Users to Excel 1 August 18th 05 02:05 AM
Code to open new workbook, prompt for 'save as' name. Mark Excel Programming 1 April 5th 05 10:49 PM
Prompt for a range to apply code to Steph[_3_] Excel Programming 2 April 29th 04 04:28 PM


All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"