Past the Value from a ListBox into next available Cell

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,340
Office Version
  1. 365
Platform
  1. Windows
This is what I tried. I know my error is in the ListBox.Value

Any help is appreciated

Private Sub CommandButton1_Click()
UnProtectit
Dim lastrow As Long
lastrow = Sheets("Submittal").Cells(Rows.Count, 1).End(xlUp).Row
ListBox2.Value Destination:=Sheets("Submittal").Range("C" & lastrow)
Application.CutCopyMode = False

Protectit

End Sub
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Not sure why you want to use Column 1 (i.e. A) for last row calculation and then update the listbox value in column C as that would be an issue in case your column C value keeps getting updated but Column A doesn't.

Hopefully this should help.

Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Cells(Lastrow + 1,"C") = ListBox2.Value

Last row is not the empty row and hence, lastrow +1 is being used.

Instead of column C you can use the number 3 or whichever column is applicable.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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