userform

  • Thread starter Thread starter Aashi
  • Start date Start date
A

Aashi

ok i have a userform.in the properties-controlsource
filed i hav put where i want the data to go on the
spreadsheet. e.g A2

but i dont always want it to go there. i want it to stay
in that column but go to the next blank cell.how?
 
Sounds like you will need to determine the last row. Try this

Sub WriteLastRow(
Dim LastRow As Intege
With Worksheets("Sheet1"
LastRow = .Cells.Find("*", [A1], , , xlByRows, xlPrevious).Ro
.Cells(LastRow + 1, 1) = Me.Textbox1.Tex
End Wit
End Su

Kevin
 
You would need the click event and write the value to that cell. Remove the
controlsource property

Private Sub Combobox1_Click()
Dim rng as Range
Set rng = Cells(rows.count,"A").End(xlup)(2)
rng.Value = combobox1.Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top