Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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
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
Drop down list question GerryD_62[_2_] Excel Worksheet Functions 2 October 17th 08 08:49 PM
List Question metaltecks Excel Discussion (Misc queries) 5 August 17th 06 04:51 PM
List Box Question Jeff Wright[_2_] Excel Programming 4 September 25th 05 07:53 PM
List Box Question Nick Excel Discussion (Misc queries) 1 March 28th 05 06:42 PM
List box question Michael Bond[_3_] Excel Programming 7 October 15th 03 03:20 PM


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