Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Assistance needed for VBA - HELP!

18 views
Skip to first unread message

Ioan Jones

unread,
Feb 4, 2000, 3:00:00 AM2/4/00
to
Hello group, I need some urgent Excel-VBA help. I am trying to get a
list/combo box populated with a list of open worksheets in the current
workbook. I need this function as I am writing a database program for Excel,
yes a database application; it's for college and were not allowed to use a
DBMS or a database engine *sigh*. Anyway, from the posts that I have read
here, you all seem to know your stuff.

So if anyone could pass on the code to populate a list box in Excel with the
worksheet names in the current work book, I would be very appreciative and
thankful for your help. I am familiar with VB but this is my first attempt
at VBA.

Sorry, if the post is off-topic but there were not that many Excel-VBA
newsgroups on my server.

P.S.

If possible, please could you send me a copy of the reply instead of
straight to the newsgroup as I rarely visit them.

Thanks again, Ioan (Student).


Edwin P. Niemoller

unread,
Feb 5, 2000, 3:00:00 AM2/5/00
to
Ioan,

Assuming you have created a userform with the name userform1 and added a
listbox to it named Listbox1, the following piece of code put all sheetnames
of the active workbook in the listbox.

Have fun

Edwin Niemoller
The Netherlands
laag...@planet.nl

Sub sheetStuff()
For n = 1 To ActiveWorkbook.Sheets.Count
UserForm1.ListBox1.AddItem ActiveWorkbook.Sheets(n).Name
Next
UserForm1.Show
End Sub

"Ioan Jones" <ioan...@btinternet.com> wrote in message
news:87hjj1$fo$1...@neptunium.btinternet.com...

0 new messages