Are you using Excel 97. In any event
The only thing I can think of is that B4 doesn't currently hold a number -
perhaps a space. You could manually clear it out, or you could protect for
that situation in your code.
if not isnumeric(Range("B4").Value) then
Range("B4").Value = 1
else
Range("B4").Value = Range("B4").Value + 1
end if
--
Regards,
Tom Ogilvy
"sisco98" wrote in message
...
Hi,
it seems good solution, thank you for it, but if I write it into my macro
and run it, I receive type mismatch error message. If I delete + and 1 at
the
end of the line, i don't get error, but this way is pointless of course:-)
would you have some advice for me about this case? Last time I didn't
write,
but I think you found out that I'm not professional VBA user...
--
sisco98
"Robert Bruce" wrote:
Roedd <<sisco98 wedi ysgrifennu:
My problem is that I 'd like that the excel would counting the number
of runs of a macro in a certain cell. For example, there is the cell
"B4" with number 1. I run a macro and when it's ended, the valu of
"B4" cell is increasing by 1 and it will be 2.
range("B4").value = range("B4").value +1 as the last line of your macro?
--
Rob
http://www.asta51.dsl.pipex.com/webcam/
This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.