VBA MOD01 Simple Input Box

 Adding Title - input box


Sub Simple_InputBox()

Dim myinp As String


myinp = VBA.Interaction. _

InputBox(prompt:="Please input Subtitle", Title:="Subtitle please ")


If myinp = "" Then Exit Sub


Range("A2").Value = Excel.WorksheetFunction.Proper(myinp)


End Sub





Input Box to add name in new line




Sub VBA_InputBox()


Dim Cname As String

Dim NextRow As Long


Cname = InputBox("CustomerName", "Name Please..")

NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1

Range("A" & NextRow).Value = Cname


Debug.Print NextRow


End Sub









Comments

Popular posts from this blog

VBA01 Copy Resize Variably Sized Ranges

VBA MOD01 Passing Arguments to sub procedures (ByRef , By Val)

PY MOD01 Lecture 01