#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default 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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro issue Farhad Excel Discussion (Misc queries) 5 December 21st 08 06:05 PM
Macro Issue thefonz37 Excel Programming 6 March 25th 08 03:51 PM
Macro Issue TimWal Excel Programming 1 October 31st 06 01:26 AM
Macro issue Steved Excel Programming 4 May 24th 06 10:08 AM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM


All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"