VBA To Add / Subtract / Multiply / Divide Every Cell by X

  • Have seen a lot of forums giving solutions where the code loops through each cell and does the operator. In a lot of cases, error handling is also required to manage cells with erroneous values.


    The following code eliminates the need to loop through each cell (in some cases, 1000s of cells), and one doesn't need to worry about erroneous cells either. It is also pretty fast, compared to looping through all those cells.



    Any corrections/suggestions are welcome.

  • Re: VBA To Add / Subtract / Multiply / Divide Every Cell by X


    Hi SMC,


    1. It doesn't work on non-contiguous range
    2. If I apply this on formula cells, it eliminates the formula


    there may be better ways..


  • Re: VBA To Add / Subtract / Multiply / Divide Every Cell by X


    Okay, following your direction I pasted this into a module:



    Then I go to my macros and run Public Sub AddSubDivMulRangeCaller(). I get a "Compile" error. The error message is "Ambiguous name detected: AddSubDivMulRange"

    So, I'm not even sure I've pasted in what needed to be pasted, and if it IS in there correctly, how to use it. Do I select figures on my spreadsheet? What does it do?