Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Passing arguments to userforms

Hi

I seem to have fixed one problem, only to find another.

I have a workbook with several worksheets.

On a main tab I have a button that loads a form and shows a list (in a
listbox) of all the tabs in the workbook.

I then want to select the tab from the list and then use that value as an
argument to then bring up another list of all the column headers in the
selected tab.

I was kind of hoping it was as simple as "load List(TabName)" but wasn't to
be.

Suggestions much appreciated.
--
Steve R
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Passing arguments to userforms

Private Sub Listbox1_click()
Dim sh as Worksheet, rng as Range
Dim cell as Range
if listbox1.listIndex < -1 then
listbox2.clear
set sh = Worksheets(Listbox1.Value)
set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,"IV").end(xltoLe ft))
for each cell in rng
listbox2.AddItem cell.Value
next
end if
End sub

--
Regards,
Tom Ogilvy


"Steve" wrote:

Hi

I seem to have fixed one problem, only to find another.

I have a workbook with several worksheets.

On a main tab I have a button that loads a form and shows a list (in a
listbox) of all the tabs in the workbook.

I then want to select the tab from the list and then use that value as an
argument to then bring up another list of all the column headers in the
selected tab.

I was kind of hoping it was as simple as "load List(TabName)" but wasn't to
be.

Suggestions much appreciated.
--
Steve R

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Passing arguments to userforms

Tom

Not what I had in mind but this is much better.

Thank you so much
--
Steve R


"Steve" wrote:

Hi

I seem to have fixed one problem, only to find another.

I have a workbook with several worksheets.

On a main tab I have a button that loads a form and shows a list (in a
listbox) of all the tabs in the workbook.

I then want to select the tab from the list and then use that value as an
argument to then bring up another list of all the column headers in the
selected tab.

I was kind of hoping it was as simple as "load List(TabName)" but wasn't to
be.

Suggestions much appreciated.
--
Steve R

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
Passing Arguments in Excell UB Excel Worksheet Functions 3 February 13th 07 04:08 PM
passing arguments to events Paul Excel Programming 2 May 24th 06 03:18 PM
Passing arguments to VB Function Tom Excel Programming 1 March 29th 06 01:19 AM
Passing Arguments Grant Reid Excel Programming 8 May 24th 04 01:39 PM
Passing arguments to a sub routine... Jeff Harbin[_2_] Excel Programming 2 January 29th 04 03:25 AM


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