Code isn't working if I use. Why so?
Works if I use
Code:
Option Explicit
Sub AddNewFilm()
Dim NewFilmName As String, NewFilmDate As Date, NewFilmLength As Integer
NewFilmName = InputBox("Type a new film name")
NewFilmDate = InputBox("Type the date")
NewFilmLength = InputBox("Type length in numbers")
Sheet1.Activate Range("A2").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = NewFilmName
ActiveCell.Offset(0, 1).Value = NewFilmDate
ActiveCell.Offset(0, 2).Value = NewFilmLength
ActiveCell.End(xlToLeft).Offset(1, 0).Select
MsgBox NewFilmName & " was added to the list"
End Sub
Works if I use
Code:
Option Explicit
Sub AddNewFilm()
Dim NewFilmName As String, NewFilmDate As Date, NewFilmLength As Integer
NewFilmName = InputBox("Type a new film name")
NewFilmDate = InputBox("Type the date")
NewFilmLength = InputBox("Type length in numbers")
Sheet1.Activate
Range("A2").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = NewFilmName
MsgBox NewFilmName & " was added to the list"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = NewFilmDate
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = NewFilmLength
ActiveCell.End(xlToLeft).Offset(1, 0).Select
End Sub
Last edited by a moderator: