Add Value from Textbox to next cell in range

M

mitch

I have a range of cells (say A4:A400). My current plan is to call up a
userform with a button, the userform has a textbox. I want the value of the
textbox to populate the next blank cell in the range of cells when I select.
Anyone have any ideas?
 
M

mitch

This is what I have so far. However, this is leaving a blank cell at the top
of the range but I don't want it to.

Range(A4:A400).Find("", ActiveCell, Searchdirection:=x1Next).Select
ActiveCell.Value =Textbox1.Text

Any other ideas?
 
B

Bernie Deitrick

Range("A4:A400").SpecialCells(xlCellTypeBlanks).Cells(1).Value =
Textbox1.Text

But if it is a number, you might want to explicitly make it one:

Range("A4:A400").SpecialCells(xlCellTypeBlanks).Cells(1).Value =
CDbl(Textbox1.Text)

HTH,
Bernie
MS Excel MVP
 

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

Top