ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro issue (https://www.excelbanter.com/excel-programming/425706-macro-issue.html)

project manager

macro issue
 
i have a macro which throws up an error message when i run it, dont have the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row L.



Howard31

macro issue
 
Try putting Value at the end:

range("R" & i).value = range("M" & i) * range("L" & i).Value

--
A. Ch. Eirinberg


"project manager" wrote:

i have a macro which throws up an error message when i run it, dont have the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row L.



Howard31

macro issue
 
Actually try putting 2 Value:

range("R" & i).value = range("M" & i).Value * range("L" & i).Value

--
A. Ch. Eirinberg


"project manager" wrote:

i have a macro which throws up an error message when i run it, dont have the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row L.



Tim Zych

macro issue
 
range(CStr("R" & i)).value = range(CStr("M" & i)).Value * range(CStr("L" &
i)).Value

or my preference

Cells(i,"R").Value = Cells(i,"M").Value * Cells(i,"L").Value


--
Tim Zych
http://www.higherdata.com
Workbook Compare - Excel data comparison utility
Free and Pro versions

"project manager" wrote in
message ...
i have a macro which throws up an error message when i run it, dont have
the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row
L.





project manager

macro issue
 
sorry they do have value at the end its error miss match 13 if that rings a
bell...

"Howard31" wrote:

Try putting Value at the end:

range("R" & i).value = range("M" & i) * range("L" & i).Value

--
A. Ch. Eirinberg


"project manager" wrote:

i have a macro which throws up an error message when i run it, dont have the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row L.



Howard31

macro issue
 
Make sure that both range("M" & i).Value and range("L" & i).Value have
numeric values and note text values
--
A. Ch. Eirinberg


"project manager" wrote:

i have a macro which throws up an error message when i run it, dont have the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row L.



Dave Peterson

macro issue
 
else
if isnumeric(range("m" & i).value) _
and isnumeric(range("L" & i).value) then
range("R" & i).value = range("M" & i).value * range("L" & i).value
else
range("R" & i) .value = "At least one is non-numeric!"
end if
end

project manager wrote:

i have a macro which throws up an error message when i run it, dont have the
whole code here but the problem line is:

else
range("R" & i).value = range("M" & i) * range("L" & i)
end

'i = target.row

i basically want the target row R to equal target row m times target row L.


--

Dave Peterson


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com