ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   mod error in VBA (https://www.excelbanter.com/excel-programming/415565-mod-error-vba.html)

geebee

mod error in VBA
 
hi,

i have the following:

R = Evaluate("mod(x,2)")

but i am getting a type mismatch error.

im not sure how to fix this..

thanks in advance,
geebee


Jim Thomlinson

mod error in VBA
 
What is x? Assuming it is a variable then you can not just have it in the
string. Try this...

R = Evaluate("mod(" & x & ",2)")
--
HTH...

Jim Thomlinson


"geebee" wrote:

hi,

i have the following:

R = Evaluate("mod(x,2)")

but i am getting a type mismatch error.

im not sure how to fix this..

thanks in advance,
geebee


Dave Peterson

mod error in VBA
 
VBA has its own Mod function, too.



geebee wrote:

hi,

i have the following:

R = Evaluate("mod(x,2)")

but i am getting a type mismatch error.

im not sure how to fix this..

thanks in advance,
geebee


--

Dave Peterson

Bob Phillips[_3_]

mod error in VBA
 
.... but it works differently to the Excel one.

--
__________________________________
HTH

Bob

"Dave Peterson" wrote in message
...
VBA has its own Mod function, too.



geebee wrote:

hi,

i have the following:

R = Evaluate("mod(x,2)")

but i am getting a type mismatch error.

im not sure how to fix this..

thanks in advance,
geebee


--

Dave Peterson




Dave Peterson

mod error in VBA
 
Yep.

(I don't have a guess if that's important to the OP, though.)



Bob Phillips wrote:

... but it works differently to the Excel one.

--
__________________________________
HTH

Bob

"Dave Peterson" wrote in message
...
VBA has its own Mod function, too.



geebee wrote:

hi,

i have the following:

R = Evaluate("mod(x,2)")

but i am getting a type mismatch error.

im not sure how to fix this..

thanks in advance,
geebee


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 05:10 PM.

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