Frank,
Nothing else makes me think of a corrupt file. This file is our most
inportant file, our whole business depnds on it. It is a large and
rather complicated file with a huge amount of VBA procedures that
more or less automate all kinds of processes. So "just create a new
workbook" is not really an option.
The key question now seems to me: why would a simple subroutine
like this
Sub Try
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=" & "countif(RC[-10]:R[199]C[-10],""*"")"
End Sub
not work in the original sheet (not in any sheet of the original
workbook!) but does what it should do in another (in any existing
or new) workbook?
I think that if my jile was corrupt I would have noticed other
strange behaviour, don't you think so?
Jack.
"Frank Kabel" <
[email protected]> schreef in bericht
Hi
maybe a corrupt file?
Just create a new workbook
--
Regards
Frank Kabel
Frankfurt, Germany
Frank,
It is even more weird. To my total confusion I discovered that
when I copy my existing sheet to a new workbook the code in the
sheet module works correct.
How is that possible, in the original workbook it won't work but
after copying the same sheet to a new workbook all problems are
gone if the code is executed in the new workbook.
Jack.
"Frank Kabel" <
[email protected]> schreef in bericht
Hi
try the following:
ActiveCell.FormulaR1C1 = "=""totaal aantal = "" &
countif(RC[-10]:R[199]C[-10],""*"")+countif(RC[-4]:R[199]C[-4],""*"")"
--
Regards
Frank Kabel
Frankfurt, Germany
Frank,
I used
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=" & "totaal aantal
=""&countif(RC[-10]:R[199]C[-10],""*"")+countif(RC[-4]:R[199]C[-4],""*"
")"
took it right from your answer, but it halts again at that line
of code. Please test it, I can't find anything wrong, but want
this thing to work.
I also tried the simpler
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=" & "countif(RC[-10]:R[199]C[-10],""*"")"
but that won't work either.
With the Dutch version of the worsheet function it also won't
work:
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=" & "AANTAL.ALS(RC[-10]:R[199]C[-10];" * ")"
but when I put manually in L1 in the worksheet
=AANTAL.ALS(B1:B200;"*") it works perfect.
It drives me crazy.
Jack.
"Frank Kabel" <
[email protected]> schreef in bericht
Hi
not tested but try:
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=" & "totaal aantal =
""&countif(RC[-10]:R[199]C[-10],""*"")+countif(RC[-4]:R[199]C[-4],""*""
)"
--
Regards
Frank Kabel
Frankfurt, Germany
Hi all,
I want to put in L1 the total number (in Dutch "totaal
aantal")
of
cells in
B1 to B200 and H1 tot H200 that contain text (there can be
nothing else in columns B and H). I tried
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=""totaal aantal =
""&countif(RC[-10]:R[199]C[-10],""*"")+countif(RC[-4]:R[199]C[-4],""*""
)"
but it results in aan errormessage (something like "error
caused
by
the
application" (roughly translated from Dutch).
Why? Should I use specialcells in stead of this formula? Any
other and perhaps more suitable way to accomplish this?
Your help will be appreciated.
Jack Sons
The Netherlands