List Box transfer to page

0 Agios

Well-known Member
Joined
Feb 22, 2004
Messages
570
Office Version
  1. 365
From a populated VB list box, that populates from page named "data", click and trasfer items to a page named "estrimate"
Thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Maybe like this

Code:
For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then Sheets("Estimate").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ListBox.List(i).Value
Next i
 
Upvote 0
Maybe like this

Code:
For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then Sheets("Estimate").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ListBox.List(i).Value
Next i

Thank you
 
Upvote 0
Maybe like this

Code:
For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then Sheets("Estimate").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ListBox.List(i).Value
Next i

I tried this code but I get an error " Object required" when I click on the populated list box
 
Upvote 0
Try this

Code:
Sub CommandButton1_Click()
Dim x As Long
For x = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(x) = True Then
        Sheets("Estimate").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ListBox1.List(x)
    End If
Next x
Unload Me
End Sub
 
Upvote 0
try this

Code:
sub commandbutton1_click()
dim x as long
for x = 0 to listbox1.listcount - 1
    if listbox1.selected(x) = true then
        sheets("estimate").range("a" & rows.count).end(xlup).offset(1).value = listbox1.list(x)
    end if
next x
unload me
end sub

it works thanks
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,820
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top