Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Need help taking values from List box to spreadsheet

I am selecting values and putting them in a list box. I need to click a
button and have those vaues sent to a worksheet page, in A2 and down. I am
totally lost on this one. Please help...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Need help taking values from List box to spreadsheet

Worksheets("Sheet1").Range("A2").End(xlDown).Value = Listbox1.Value

--
HTH

Bob Phillips

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

"trward79" wrote in message
...
I am selecting values and putting them in a list box. I need to click a
button and have those vaues sent to a worksheet page, in A2 and down. I am
totally lost on this one. Please help...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Need help taking values from List box to spreadsheet

I tried this, it does not take anything unless I select the value manualy.
Then it does that value only, and no others.

"Bob Phillips" wrote:

Worksheets("Sheet1").Range("A2").End(xlDown).Value = Listbox1.Value

--
HTH

Bob Phillips

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

"trward79" wrote in message
...
I am selecting values and putting them in a list box. I need to click a
button and have those vaues sent to a worksheet page, in A2 and down. I am
totally lost on this one. Please help...




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help taking values from List box to spreadsheet

Private Sub CommandButton1_Click()
Dim v as Variant
v = UserForm1.ListBox1.List
With Worksheets("Sheet4").Range("A2")
.Resize(UBound(v) - LBound(v) + 1, 1).Value = v
End With
End Sub

worked for me.

--
Regards,
Tom Ogilvy


"trward79" wrote in message
...
I am selecting values and putting them in a list box. I need to click a
button and have those vaues sent to a worksheet page, in A2 and down. I am
totally lost on this one. Please help...



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Need help taking values from List box to spreadsheet

Where is the listbox?

Is it on a userform?

Is it on a worksheet? If it's on a worksheet, is the listbox from the Forms
toolbar or from the control toolbox toolbar?

I'm gonna guess it's on a worksheet and from the control toolbox toolbar--with a
button from the control toolbox that does the work.

Option Explicit
Private Sub CommandButton1_Click()

Dim iCtr As Long
Dim DestCell As Range

Set DestCell = Me.Range("a2")

With Me.ListBox1
DestCell.Resize(.ListCount).ClearContents
For iCtr = 0 To .ListCount - 1
If .Selected(iCtr) Then
DestCell.Value = .List(iCtr)
Set DestCell = DestCell.Offset(1, 0)
End If
Next iCtr
End With

End Sub

trward79 wrote:

I tried this, it does not take anything unless I select the value manualy.
Then it does that value only, and no others.

"Bob Phillips" wrote:

Worksheets("Sheet1").Range("A2").End(xlDown).Value = Listbox1.Value

--
HTH

Bob Phillips

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

"trward79" wrote in message
...
I am selecting values and putting them in a list box. I need to click a
button and have those vaues sent to a worksheet page, in A2 and down. I am
totally lost on this one. Please help...





--

Dave Peterson
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
Taking a list LittleC Excel Discussion (Misc queries) 0 November 18th 10 01:23 AM
taking conditions from one spreadsheet to another Analyst in the making Excel Worksheet Functions 3 July 3rd 08 12:46 PM
taking a long list of duplicates... DFrank Excel Discussion (Misc queries) 4 June 27th 08 10:21 PM
Taking values from another cell SK Excel Discussion (Misc queries) 6 November 16th 07 12:19 AM
taking out lowest 2 values georgette Excel Worksheet Functions 4 January 10th 06 03:13 AM


All times are GMT +1. The time now is 02:50 AM.

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"