Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default one combobox affecting another

Hi,
I have 2 comboboxes ("Business" and "Name"). When Business is selected I
would like Name to populate with all the names on the sheet that is named
Business.

I have tried the following code but get an error message saying that Name is
an invalid qualifier. Can you change one comobox with another or is my code
just flawed?

Private Sub Business_Change()

Sheets("" & Business).Select
Range("E7").Activate
While ActiveCell < ""
Name.AddItem ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
Wend

End Sub

Thanks for any help you can offer.
JohnP
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default one combobox affecting another

You can't name the userform NAME it is a reserved word in Basic. change it
to MName. You can still have the caption called Name. also you need to put
double quotes around the sheet name business unless it is a variable.

Private Sub Business_Change()
Sheets("Business").Select
Range("E7").Activate
While ActiveCell < ""
UserForm1.MName.AddItem ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
Wend

End Sub


"JohnP" wrote:

Hi,
I have 2 comboboxes ("Business" and "Name"). When Business is selected I
would like Name to populate with all the names on the sheet that is named
Business.

I have tried the following code but get an error message saying that Name is
an invalid qualifier. Can you change one comobox with another or is my code
just flawed?

Private Sub Business_Change()

Sheets("" & Business).Select
Range("E7").Activate
While ActiveCell < ""
Name.AddItem ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
Wend

End Sub

Thanks for any help you can offer.
JohnP

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
sorting without affecting the format alyndejs New Users to Excel 1 October 19th 07 03:18 PM
I'd like to Sort one column without affecting the others Legna105 Excel Worksheet Functions 5 October 2nd 07 11:54 PM
sort worksheet without affecting workbook Barry Excel Worksheet Functions 3 November 2nd 05 10:06 PM
sorting without affecting links Kt Excel Discussion (Misc queries) 1 October 30th 05 11:54 AM
macros affecting different worksheets CJW Excel Discussion (Misc queries) 1 September 2nd 05 04:29 PM


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