Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default if not isempty combobox does not work ?

Hi,

I have the following piece of code for two comboboxes in a userform;

If Not IsEmpty(zoekwg.Value) Then
'This Combobox was selected
klantkeuze = zoekwg.Value
Set klantmatrix =
Worksheets("datadga").Range("B2:b500").Find(klantk euze)
ElseIf Not IsEmpty(zoekdga.Value) Then
'Combobox2 was selected
klantkeuze = zoekdga.Value
Set klantmatrix =
Worksheets("datadga").Range("B2:b500").Find(klantk euze)
End If

If box1 is empty then it should look if there is something in box2
However, allthough I put nothing in box1, it still sees it as NOT empty !

The code for filling the boxes is;

zoekdga.RowSource = "B2:B1000"
zoekwg.RowSource = "B1:FX1000"

I would like to have the first piece of code check if the user has input
something in box1. If the user didn't it should do the same in box2.

Any suggestions?
Thanks,
Pierre


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default if not isempty combobox does not work ?

Try

If zoekwg.Value < "" Then

"Pierre" wrote:

Hi,

I have the following piece of code for two comboboxes in a userform;

If Not IsEmpty(zoekwg.Value) Then
'This Combobox was selected
klantkeuze = zoekwg.Value
Set klantmatrix =
Worksheets("datadga").Range("B2:b500").Find(klantk euze)
ElseIf Not IsEmpty(zoekdga.Value) Then
'Combobox2 was selected
klantkeuze = zoekdga.Value
Set klantmatrix =
Worksheets("datadga").Range("B2:b500").Find(klantk euze)
End If

If box1 is empty then it should look if there is something in box2
However, allthough I put nothing in box1, it still sees it as NOT empty !

The code for filling the boxes is;

zoekdga.RowSource = "B2:B1000"
zoekwg.RowSource = "B1:FX1000"

I would like to have the first piece of code check if the user has input
something in box1. If the user didn't it should do the same in box2.

Any suggestions?
Thanks,
Pierre



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default if not isempty combobox does not work ?

Hi Joel,

djee....that was simple.
Sorry for making it so troublesome.
Thanks for your help,
Pierre

"Joel" schreef in bericht
...
Try

If zoekwg.Value < "" Then

"Pierre" wrote:

Hi,

I have the following piece of code for two comboboxes in a userform;

If Not IsEmpty(zoekwg.Value) Then
'This Combobox was selected
klantkeuze = zoekwg.Value
Set klantmatrix =
Worksheets("datadga").Range("B2:b500").Find(klantk euze)
ElseIf Not IsEmpty(zoekdga.Value) Then
'Combobox2 was selected
klantkeuze = zoekdga.Value
Set klantmatrix =
Worksheets("datadga").Range("B2:b500").Find(klantk euze)
End If

If box1 is empty then it should look if there is something in box2
However, allthough I put nothing in box1, it still sees it as NOT empty !

The code for filling the boxes is;

zoekdga.RowSource = "B2:B1000"
zoekwg.RowSource = "B1:FX1000"

I would like to have the first piece of code check if the user has input
something in box1. If the user didn't it should do the same in box2.

Any suggestions?
Thanks,
Pierre





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
Combobox - MatchRequired does not work? Wim SKW Excel Programming 2 December 7th 09 02:01 PM
How to populate a combobox with the name of all the sheets in work Gordon[_2_] Excel Programming 5 October 30th 05 12:10 AM
Userform: Combobox, dates, match required- can't get date format to work KR Excel Programming 2 November 10th 04 05:18 PM
using protection (but allowing a combobox to still work) neowok[_39_] Excel Programming 5 March 4th 04 02:48 PM
Help with IsEmpty Fred Excel Programming 1 February 10th 04 03:12 PM


All times are GMT +1. The time now is 04:43 AM.

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"