Hello everybody, I am a beginner in vba (and this forum) and I found the Thread to create a row and input data alphabetically here:
I am using Excel 2013.
http://www.mrexcel.com/forum/excel-...ly-into-column-visual-basic-applications.html
The problem is: I want the input to be started at the cell B6, B7, B8 and so on (until the end of the column, cell 65536 I believe).
I know that I should change my range input in the last row of this code, I managed to change the input to be in B but I can`t get it to work starting in the 6th row....
Can someone help me please?
Thank you :D .
I am using Excel 2013.
http://www.mrexcel.com/forum/excel-...ly-into-column-visual-basic-applications.html
The problem is: I want the input to be started at the cell B6, B7, B8 and so on (until the end of the column, cell 65536 I believe).
I know that I should change my range input in the last row of this code, I managed to change the input to be in B but I can`t get it to work starting in the 6th row....
Can someone help me please?
Code:
Sub InsertName()
Dim sNewName As String
Dim lPosition As Long
Dim rEmpList As Range
Set rEmpList = Sheets("Sheet1").Range("B1:B65536")
sNewName = InputBox("Enter name of new employee")
On Error Resume Next 'if employee needs to go at start of list, Match will return #NA
lPosition = Application.WorksheetFunction.Match(sNewName, rEmpList, 1)
On Error GoTo 0 'revert to normal error handling (crashing)
Rows(lPosition + 1).Insert
[B]Range("B" & lPosition + 1).Value = sNewName
[/B]
End Sub
Thank you :D .
Last edited: