ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo Headache (https://www.excelbanter.com/excel-programming/375290-combo-headache.html)

Zaahir

Combo Headache
 
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox. The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards


Bob Phillips

Combo Headache
 
Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox. The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards




Zaahir

Combo Headache
 
Hi
when adding this code into "Private Sub UserForm_Initialize()" the button

Private Sub cmdNewEntry_Click()
UserForm1.Show
End Sub
returns with an error code "Run-time error 9" "Subscript out of range"
is the code for the button in the wrong place?

"Bob Phillips" wrote:

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox. The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards





Bob Phillips

Combo Headache
 
That presumably means that your worksheet is not named B, you need to change
that.

You could also change the VBE options (ToolsOptions) to break on all errors
(on the General tab, Errors frame) so you see the real error.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
Hi
when adding this code into "Private Sub UserForm_Initialize()" the button

Private Sub cmdNewEntry_Click()
UserForm1.Show
End Sub
returns with an error code "Run-time error 9" "Subscript out of range"
is the code for the button in the wrong place?

"Bob Phillips" wrote:

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox. The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards







Zaahir

Combo Headache
 
i hav changed it to the name of the workbook and the sheet, & thats the error
msg returnd as well as the error setting on the options!!!!!!

"Bob Phillips" wrote:

That presumably means that your worksheet is not named B, you need to change
that.

You could also change the VBE options (ToolsOptions) to break on all errors
(on the General tab, Errors frame) so you see the real error.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
Hi
when adding this code into "Private Sub UserForm_Initialize()" the button

Private Sub cmdNewEntry_Click()
UserForm1.Show
End Sub
returns with an error code "Run-time error 9" "Subscript out of range"
is the code for the button in the wrong place?

"Bob Phillips" wrote:

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox. The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards








Bob Phillips

Combo Headache
 
Sorry, I missed a vital part

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100").Address(, , ,
True)
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
i hav changed it to the name of the workbook and the sheet, & thats the

error
msg returnd as well as the error setting on the options!!!!!!

"Bob Phillips" wrote:

That presumably means that your worksheet is not named B, you need to

change
that.

You could also change the VBE options (ToolsOptions) to break on all

errors
(on the General tab, Errors frame) so you see the real error.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
Hi
when adding this code into "Private Sub UserForm_Initialize()" the

button

Private Sub cmdNewEntry_Click()
UserForm1.Show
End Sub
returns with an error code "Run-time error 9" "Subscript out of range"
is the code for the button in the wrong place?

"Bob Phillips" wrote:

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox.

The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards










Zaahir

Combo Headache
 

hi
kay no prob...
i still cant get it to run, but opted to create a sheet2,named DB & set the
rowsource property to DB!"Range", this helps but now evry1 can see the
database..... Any ideas on how to hide the data or protect it via code or do
u think i should opt for the easiest route "password protection"
"Bob Phillips" wrote:

Sorry, I missed a vital part

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100").Address(, , ,
True)
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
i hav changed it to the name of the workbook and the sheet, & thats the

error
msg returnd as well as the error setting on the options!!!!!!

"Bob Phillips" wrote:

That presumably means that your worksheet is not named B, you need to

change
that.

You could also change the VBE options (ToolsOptions) to break on all

errors
(on the General tab, Errors frame) so you see the real error.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
Hi
when adding this code into "Private Sub UserForm_Initialize()" the

button

Private Sub cmdNewEntry_Click()
UserForm1.Show
End Sub
returns with an error code "Run-time error 9" "Subscript out of range"
is the code for the button in the wrong place?

"Bob Phillips" wrote:

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox.

The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards












All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com