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

3 thoughts on “Macro to populate columns from input boxes putting information in wrong areas

  1. ig

    Magnificent goods from you, man. I have take into accout your stuff previous to and you’re simply too magnificent.
    I actually like what you’ve got here, really like what you are stating and the best way in which
    you say it. You make it enjoyable and you continue to take care of to
    stay it wise. I can not wait to learn much more from you.
    That is actually a wonderful website.

  2. Daphine Amelung

    Admiring the time and energy you put into your website and detailed information you present. It’s good to come across a blog every once in a while that isn’t the same out of date rehashed material. Great read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

Comments are closed.