Macro to populate columns from input boxes putting information in wrong areas


I have a macro to populate the column data in an autofill.  One column will be for the # of evalution days in a month, the other will be the number of shipping days.  When I run the macro and input the 2 numbers the D3 column turns to say “Shipping Days” and the data gets input to the rest of the column.  The ship days input works fine.

I just can’t figure out why the D3 turns to Shipping Days rather than put the input # from the days evaluation.  Here’s the code:

Sub Days()
lastrow = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = “Days Eval”


ActiveCell.FormulaR1C1 = InputBox(“Number of Evaluation Days”)


Selection.AutoFill Destination:=Range(“D3:D” & lastrow)

Range(“D3:D” & lastrow).Select


lastrow = ActiveSheet.UsedRange.Rows.Count

ActiveCell.FormulaR1C1 = “Shipping Days”


ActiveCell.FormulaR1C1 = InputBox(“Number of Shipping Days”)


Selection.AutoFill Destination:=Range(“E3:E” & lastrow)

Range(“E3:E” & lastrow).Select

End Sub

By: Tammi

Leave a Reply

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