Paste Data from Input Box into a Cell

I have a work in progress here but I’ve run into a snag. I’m trying to create a copy of a template sheet put it at the end, then go back to the Index sheet find the next row with no data and and have the user name the new sheet using an input box and put that data into Cell A of that row. Here is what I have so far:Private Sub CreateNewSheet_Click()
Dim myStr As String
Dim Answer As Variant

Sheets("SWD Template").Select
Sheets("SWD Template").Copy After:=Sheets(Sheets.Count)
Sheets("1-Project Index").Select
nextrow = Cells.Find(What:="*", searchdirection:=xlPrevious, SearchOrder:=xlByRows).Row + 1
Cells(nextrow, 1).Select
Answer = InputBox("Name next SWD")
If Answer = "" Then Exit Sub
'ActiveWorkbook.Sheets("1-Project Index").Range(“nextrow”).Value = Answer

End Sub

Everything works but the bottom line but that’s not a suprise to me because I’ve never really programed anything in VB. After I get this working I will need to continue the macro to complete the formula’s for the cells next to the name. so I don’t want it to end unless they don’t enter a name.

One thought on “Paste Data from Input Box into a Cell

  1. Kat

    Hi there

    You could try replacing the last line of code with this line…

    ActiveWorkbook.Sheets("1-Project Index").Cells(nextrow, 1).Value = Answer

    I have presumed you wanted the Answer value entered into column A. Is this a safe assumption?

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *