Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Application.Inputbox Type2

Hi all,

Any idea why the variable FilterCriteria below is Null? When I step
through the If FilterCriteria in Nothing Then step, it goes to exit
sub. When prompted with the inputbox, I did enter text. Thanks!

On Error Resume Next
Set FilterCriteria = Application.InputBox(prompt:= _
"Enter Filter Criteria", Type:=2)
If FilterCriteria Is Nothing Then
Exit Sub
End If
On Error GoTo 0
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Application.Inputbox Type2

"Steve" wrote in message
...
Hi all,

Any idea why the variable FilterCriteria below is Null? When I step
through the If FilterCriteria in Nothing Then step, it goes to exit
sub. When prompted with the inputbox, I did enter text. Thanks!

On Error Resume Next
Set FilterCriteria = Application.InputBox(prompt:= _
"Enter Filter Criteria", Type:=2)
If FilterCriteria Is Nothing Then
Exit Sub
End If
On Error GoTo 0



Presumably FilterCriteria is a variant .... Set is an Object oriented
statement, and Nothing is an Object property. You are returning a text
string, which is not an object. I expect that if you take out the On
Error Resume Next you will get run-time errors that would help you
debug.

Try:
FilterCriteria = Application.InputBox(prompt:= _
"Enter Filter Criteria", Type:=2)
If IsEmpty(FilterCriteria) Then
Exit Sub
End If

You can put the On Error back in after you finish your testing.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Application.Inputbox Type2

Right on the money! Thanks Clif!!

On May 25, 5:37*pm, "Clif McIrvin" wrote:
"Steve" wrote in message

...

Hi all,


Any idea why the variable FilterCriteria below is Null? *When I step
through the If FilterCriteria in Nothing Then step, it goes to exit
sub. *When prompted with the inputbox, I did enter text. *Thanks!


*On Error Resume Next
* *Set FilterCriteria = Application.InputBox(prompt:= _
* * * * * *"Enter Filter Criteria", Type:=2)
* * * *If FilterCriteria Is Nothing Then
* * * * * *Exit Sub
* * * *End If
*On Error GoTo 0


Presumably FilterCriteria *is a variant .... Set is an Object oriented
statement, and Nothing is an Object property. You are returning a text
string, which is not an object. I expect that if you take out the On
Error Resume Next you will get run-time errors that would help you
debug.

Try:
* * *FilterCriteria = Application.InputBox(prompt:= _
* * * * * * "Enter Filter Criteria", Type:=2)
* * * * If IsEmpty(FilterCriteria) Then
* * * * * * Exit Sub
* * * * End If

You can put the On Error back in after you finish your testing.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Application.Inputbox Type2

You're welcome

"Steve" wrote in message
...
Right on the money! Thanks Clif!!

On May 25, 5:37 pm, "Clif McIrvin" wrote:
"Steve" wrote in message

...

Hi all,


Any idea why the variable FilterCriteria below is Null? When I step
through the If FilterCriteria in Nothing Then step, it goes to exit
sub. When prompted with the inputbox, I did enter text. Thanks!


On Error Resume Next
Set FilterCriteria = Application.InputBox(prompt:= _
"Enter Filter Criteria", Type:=2)
If FilterCriteria Is Nothing Then
Exit Sub
End If
On Error GoTo 0


Presumably FilterCriteria is a variant .... Set is an Object oriented
statement, and Nothing is an Object property. You are returning a text
string, which is not an object. I expect that if you take out the On
Error Resume Next you will get run-time errors that would help you
debug.

Try:
FilterCriteria = Application.InputBox(prompt:= _
"Enter Filter Criteria", Type:=2)
If IsEmpty(FilterCriteria) Then
Exit Sub
End If

You can put the On Error back in after you finish your testing.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)





--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


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 Application.InputBox(,,,,,8) JsJ_Slim Excel Programming 3 August 8th 08 02:32 AM
Application.InputBox Steven Excel Programming 2 December 23rd 06 11:56 PM
application.inputbox Christmas May[_2_] Excel Programming 5 November 22nd 06 04:11 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
application.inputbox Murat Excel Programming 4 February 24th 04 11:38 AM


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