Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
list box question
I now have a populated list box on my form. I now need to take each
value (its the name of a named range) and copy that range to another sheet... How do I create the loop ?????? On Error Resume Next Sheets(Me.DestTextBox.Text).Delete Sheets.Add ActiveSheet.Name = Me.DestTextBox.Text 'my sheet The "somehow read the RightListBox starting with the first entry" Loop Set lastcell = Cells.SpecialCells(xlLastCell)' find the last mrows = lastcell.Row ' used row Set rng = the first item in the list rng.Copy Destination:=Worksheets(Me.DestTextBox.Text).Range ("A" & (mrows + 1)) Next entry Any ideas ?????? Thanks Chris |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
list box question
Hi
Using an ActiveX listbox: Sub test() Dim L As Long Dim S As String For L = 0 To Me.ListBox1.ListCount - 1 S = Me.ListBox1.List(L) MsgBox S Next End Sub HTH. Best wishes Harald "Chris Salcedo" skrev i melding ups.com... I now have a populated list box on my form. I now need to take each value (its the name of a named range) and copy that range to another sheet... How do I create the loop ?????? On Error Resume Next Sheets(Me.DestTextBox.Text).Delete Sheets.Add ActiveSheet.Name = Me.DestTextBox.Text 'my sheet The "somehow read the RightListBox starting with the first entry" Loop Set lastcell = Cells.SpecialCells(xlLastCell)' find the last mrows = lastcell.Row ' used row Set rng = the first item in the list rng.Copy Destination:=Worksheets(Me.DestTextBox.Text).Range ("A" & (mrows + 1)) Next entry Any ideas ?????? Thanks Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop down list question | Excel Worksheet Functions | |||
List Question | Excel Discussion (Misc queries) | |||
List Box Question | Excel Programming | |||
List Box Question | Excel Discussion (Misc queries) | |||
List box question | Excel Programming |