Automatic completing of names and ID numbers - Problem.. help

  • Thread starter Thread starter Lurch Kimded
  • Start date Start date
L

Lurch Kimded

How about this one for a first post - I am trying to code in VBA fo
Excel 97 a program that will take from a list of staff (with payrol
numbers) on one sheet in a workbook the name and ID into the correc
cells in a pre-created signing on sheet which is in the same workbook.

I have managed to figure out (on paper) how to activate the defaul
sheet, copy and rename it and then delete it when I'm finished bu
after that I'm stumped. Basically I have no idea how to get it to cop
the cells over, move down the list and then keep on going no matter ho
long the list is on.

I've attached a copy of sheet I am working on (so you can see th
format of the signing on sheet mainly), any help would be massivel
appreciated. This is my first real attempt at doing this sort of thin
but I have done programming before. So even just pointing me in th
direction of where to go (careful ;-) would be cool.

Thanks for any help.
Lurch Kimded <>

+----------------------------------------------------------------
| Attachment filename: signon.xls
|Download attachment: http://www.excelforum.com/attachment.php?postid=369268
+----------------------------------------------------------------
 
Sub CreateTimeSheets()

Dim myRange As Range

Sheets("Staff_List").Select
Range("A1").Select
Set myRange = ActiveCell.CurrentRegion
LastRow = myRange.Cells(myRange.Cells.Count).Row

For i = 1 To LastRow

' put in here whatever it is you want to do with each name on your
list

Next i


End Sub
 
Here is a sub that should get you started. You should have a defined name
for myrange that is self adjusting when you add employees and it should be
for column B in your example. You also want the macro to copy the employee
name and id number to the new sheet.

Sub mynewsheets()
For Each c In Range("myrange")
On Error Resume Next
If Sheets.Name <> c Then
Sheets.Add.Name = c
End If
Next c
End Sub
 
Back
Top