Search code examples
excelvbabasic

Excel VBA - Creating a textbox that fills the active cell


I want to create a macro, that inputs a string into the next available cell, in a defined row. So when the next available cell is found, a inputbox appears, the user types in the data, and then the data goes into the active cell.

I currently have this:

Sub Find_Blank_Row()
Dim QtyInput As String
Dim BlankRow As Long
BlankRow = Range("A65536").End(xlUp).Row + 1
Cells(BlankRow, 1).Select
QtyInput = InputBox("please Enter Company Name")
ActiveRow.Font.Bold = True
ActiveSheet.Range("ActiveCell").Value = QtyEntry
End Sub

How do I make this work?

Thanks in advance.


Solution

  • The answerL

     Sub Find_Blank_Row()
     Dim QtyInput As String
     Dim BlankRow As Long
     BlankRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
     QtyInput = InputBox("Please Enter Company Name")
     Cells(BlankRow, 1).Font.Bold = True
     Cells(BlankRow, 1).Value = QtyInput
     End Sub