Hi, there,
I'm still quite new in this and struggling with a macro for staff data input. I have an input box on the first page and I want to save the first few inputs on the first page and next few on second page, but to match the record for the same person. I hope I was clear. Can you give a hand, please?
Here is my code:
Keyboard Shortcut: Ctrl+r
'
Dim Date_Input
Dim Date_Joined As Date
Range("Block_Start").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell = InputBox("Enter Surname", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
ActiveCell = InputBox("Enter Initials", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
ActiveCell = InputBox("Enter Department", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
ActiveCell = InputBox("Enter Phone Number", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
GetDate:
Date_Input = InputBox("Enter Date Joined", "Staff List")
'
' Solicit the date into Date_input (Dim'ed As Variant)
' Validate Date_Input to contain a valid date value
' Move Date_Input into Date_Joined (Dim'ed as Date) to ensure value is treated as local (European) date
'
If Date_Input = "" Then End
If Not IsDate(Date_Input) Then GoTo GetDate
Date_Joined = Date_Input
ActiveCell = Date_Joined
ActiveCell.Offset(-1, 1).Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A2"), Type:= _
xlFillDefault
ActiveCell.Range("A1:A2").Select
Range("A1").Select
ActiveCell = InputBox("Enter Home Address", "Staff List")
If ActiveCell = "" Then End
Worksheets("Sheet2").Activate
Cells.Offset(5, 2).Select
End Sub
Thank you in advance!
I'm still quite new in this and struggling with a macro for staff data input. I have an input box on the first page and I want to save the first few inputs on the first page and next few on second page, but to match the record for the same person. I hope I was clear. Can you give a hand, please?
Here is my code:
Keyboard Shortcut: Ctrl+r
'
Dim Date_Input
Dim Date_Joined As Date
Range("Block_Start").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell = InputBox("Enter Surname", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
ActiveCell = InputBox("Enter Initials", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
ActiveCell = InputBox("Enter Department", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
ActiveCell = InputBox("Enter Phone Number", "Staff List")
If ActiveCell = "" Then End
ActiveCell.Offset(0, 1).Select
GetDate:
Date_Input = InputBox("Enter Date Joined", "Staff List")
'
' Solicit the date into Date_input (Dim'ed As Variant)
' Validate Date_Input to contain a valid date value
' Move Date_Input into Date_Joined (Dim'ed as Date) to ensure value is treated as local (European) date
'
If Date_Input = "" Then End
If Not IsDate(Date_Input) Then GoTo GetDate
Date_Joined = Date_Input
ActiveCell = Date_Joined
ActiveCell.Offset(-1, 1).Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A2"), Type:= _
xlFillDefault
ActiveCell.Range("A1:A2").Select
Range("A1").Select
ActiveCell = InputBox("Enter Home Address", "Staff List")
If ActiveCell = "" Then End
Worksheets("Sheet2").Activate
Cells.Offset(5, 2).Select
End Sub
Thank you in advance!