I have an excel workbook with three sheets "Benefits", "Factors" and "Assumptions". I have to multiply a variable Range from Cell(14, 35) to Cell(13 + Term, 35) on sheet "Benefits" with a constant which is inputted in a cell defined on sheet "Assumptions" with name "FactorMultiple". After multiplying the new range of values is to be pasted on sheet "Factors" in cell (1,1).
I am using following code for multiplication in vba:
Set FactRange = Range(Cells(14, 35), Cells(13 + Term, 35))
FactRange = FactRange * [FactorMultiple]
This code gives error "Type mismatch". I have tried to get solutions on this error but there was no simple one line code for multiplication.
Some time before I have to do the same sort of operation in another excel workbook. The only difference was that the range in that workbook was defined as a named range in excel, say "Range1" and the constant with which this range was to be multiplied was also defined with a name in excel, Say "MulCon". In vba of that workbook I used following code and it worked fine:
[Range1]=[Range1 * MulCon]
Is there any such kind of single line code for the multiplication I have mentioned at start of this query.
I am using following code for multiplication in vba:
Set FactRange = Range(Cells(14, 35), Cells(13 + Term, 35))
FactRange = FactRange * [FactorMultiple]
This code gives error "Type mismatch". I have tried to get solutions on this error but there was no simple one line code for multiplication.
Some time before I have to do the same sort of operation in another excel workbook. The only difference was that the range in that workbook was defined as a named range in excel, say "Range1" and the constant with which this range was to be multiplied was also defined with a name in excel, Say "MulCon". In vba of that workbook I used following code and it worked fine:
[Range1]=[Range1 * MulCon]
Is there any such kind of single line code for the multiplication I have mentioned at start of this query.