end of list

sine~language

New Member
Joined
Dec 10, 2005
Messages
3
I've created a Staff Roster which contains a column with a list of names repeated 3 times down (1 for each shop): i.e.

Bob
Jane
Fred

Bob
Jane
Fred

Bob
Jane
Fred

I would like to include an "Add Staff" function, which would add a new row beneath each of the Freds in the above example. The main thing I'm unsure of is writing a function or macro to recognise the end of the list of staff.

Thanks in advance..
Scott
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Barrie Davidson

MrExcel MVP
Joined
Feb 10, 2002
Messages
2,330
Would this code work for you?
Code:
Sub AddEmployee()
'Written by Barrie Davidson
Dim NewEmployee As String

NewEmployee = InputBox("Enter New Employee Name")
Range("A1").End(xlDown).Offset(1).EntireRow.Insert
Range("A1").End(xlDown).Offset(1).Value = NewEmployee
Range("A1").End(xlDown).End(xlDown).End(xlDown).Offset(1).EntireRow.Insert
Range("A1").End(xlDown).End(xlDown).End(xlDown).Offset(1).Value = NewEmployee
Range("A1").End(xlDown).End(xlDown).End(xlDown).End(xlDown).End(xlDown).Offset(1).EntireRow.Insert
Range("A1").End(xlDown).End(xlDown).End(xlDown).End(xlDown).End(xlDown).Offset(1).Value = NewEmployee

End Sub

Regards,
 

Watch MrExcel Video

Forum statistics

Threads
1,118,530
Messages
5,572,686
Members
412,481
Latest member
nhantam
Top