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: 9
Default Adding Options When User Cancels/Cannot Find

Hi everyone,

Much thanks in advance for any help.

I'm putting together the two below macros. The first to ask the user
for a vendor name, and then it searches (easy enough!). When I search
for a vendor that is not there, I get an error to debug. I'd like an
error box to pop up. I just learned userforms today so I'm thinking
maybe that would work as an option? Any advice would be greatly
appreciated.

(1)*********

Dim sUsername As String
Dim sPrompt As String
sPrompt = "Please enter vendor name"
sUsername = InputBox(sPrompt, sTitle, sDefault)

Sheets("list").Select
Range("C2").Select
Cells.Find(What:=sUsername, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Select
 
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
OPENFILENAME A P I. User cancels ? DZ Excel Programming 1 December 24th 07 09:09 PM
Deleting a menu in BeforeClose but user Cancels the Save LRL Excel Programming 2 November 17th 05 06:38 PM
Problem is adding options to ComboBox shilps Excel Programming 0 April 16th 04 01:43 PM
How to present User with Print Options Stuart[_5_] Excel Programming 0 August 21st 03 07:11 PM
How to extend user options Dave Peterson[_3_] Excel Programming 0 August 14th 03 03:51 AM


All times are GMT +1. The time now is 12:39 PM.

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"