Search code examples
vbaforeachrangeexcel-2007

To multiply column with textbox value in vba


I have textbox1 in excel sheet and list of values in column A. As textbox is user defined, I have to multiply given value with the all the values available in column A. How it can be done using command button if I am not using a form.

rng = Evaluate(rng.Address &"*TextBox1.Value")

But is giving an error #NAME? in excel.


Solution

  • I got the solution and it should be

    Value = Textbox1.Value

    rng = Evaluate("=" & rng.Address & "*" & value)

    Hope it will be useful for someone

    Thanks