Thread: Help with Code
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim G Jim G is offline
external usenet poster
 
Posts: 132
Default Help with Code

It doesn't do on other workbooks or on a blank sheet with the code added.
However, on this particualar work book it does it every 4th row. If I skip a
row the count starts again. In otehr words, the third row of data entry
brings up the error message, so it counts the blank row.

I added the debug message. the result was the result of the formula that
was copied in from G19. If I delete the formula (=F19/1.1) or change it to
D19/1.1, it will work as expected. Change back to F19 and it stops again.

Would there be something else going on with F19 and how could I find it?

For now, I've taken out the eeror check on the working template. However, I
would like to get to the bottom of it. If anyone wants it, it can email the
file.

--
Jim


"p45cal" wrote:


I can't see why it should be doing that, so it's time to debug:

after the line:
If target.Offset(0, 1).Value < "" Then
add the following:
Stop
MsgBox "Target offset (0,1) contains what's between the pairs of xs:
xx" & target.Offset(0, 1).Value & "xx"
Try the code, when it stops, use F8 to step through the lines one by
one. You say there's nothing in that cell, so you might expect to see
'xxxx', however I suspect you'll see the likes of 'xx xx', that is a
space, in the cell.
Pressing F5 allows the macro to proceed as normal again.
Over to you.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=135641