Hello all,
I am trying to write a code. I need the code to do the following:
An input box asks for a number,
Then the below code divides values in a given column and paste them in the next available empty column. Then the 2nd formula runs and it places the values in the next available column.
Now this routine should repeat as many time as the number in the input box.
I have written/recorded the following but dont know how to add the input box which should do as i explained above.
Sub Analysis()
rowcounter = Intersect(ActiveSheet.UsedRange, Columns("B:D")).Rows.Count
For i = 18 To rowcounter
Range("E" & i).FormulaArray = "=ROUNDDOWN((R34C4/2)/R34C4*RC[-3],0)"
Range("F" & i).FormulaArray = "=ROUNDDOWN(RC[-1]*RC[-3],0)"
If Range("B" & i) = "" And Range("C" & i) = "" Then
Range("E" & i) = ""
End If
Next i
End Sub
Please let me know if you need any more information.
Thanks for help,
Shah.