Dont know if this has been answered already but I'll ask anyway.
I am currently entering names onto a spreadsheet using a userform. what i need this to do is then create a new worksheet using the firstname only. here is what i have already to enter the code, any help would be greatly appreciated
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Team Details")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtFirstName.Value) = "" Then
Me.txtFirstName.SetFocus
MsgBox "Please enter a part number"
Exit Sub
End If
'copy the data to the spreadsheet
ws.Cells(iRow, 1).Value = Me.txtFirstName.Value
ws.Cells(iRow, 2).Value = Me.txtSecondName.Value
'clear the data
Me.txtFirstName.Value = ""
Me.txtSecondName.Value = ""
Me.txtFirstName.SetFocus
End Sub
Any ideas on what I can put in to create the new sheets?
I am currently entering names onto a spreadsheet using a userform. what i need this to do is then create a new worksheet using the firstname only. here is what i have already to enter the code, any help would be greatly appreciated
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Team Details")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtFirstName.Value) = "" Then
Me.txtFirstName.SetFocus
MsgBox "Please enter a part number"
Exit Sub
End If
'copy the data to the spreadsheet
ws.Cells(iRow, 1).Value = Me.txtFirstName.Value
ws.Cells(iRow, 2).Value = Me.txtSecondName.Value
'clear the data
Me.txtFirstName.Value = ""
Me.txtSecondName.Value = ""
Me.txtFirstName.SetFocus
End Sub
Any ideas on what I can put in to create the new sheets?