View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default help with a piece of code

Questions and comments...
'--
Did you leave out part of the code?
I had to change the "ElseIf" immediately below "12 hour calendar" to "If".

What is the value of the counters when the error occurs?
You should change the counter variables from Integer to Long.

If you can figure out what "Cells" belong to which sheet then you
should qualify them with the sheet name...
Sheets("calc").Cells(1, counter).Value
Sheets("junk").Cells(counter1 + 1, 5)
--
Jim Cone
Portland, Oregon USA





"Joseph Atie"
wrote in message
Im getting the error Method 'Cells' of object '_Global' failed on the
following function
My understanding is this is because im havent explicitly defined the sheet
im working in.
I have placed **ERROR ON THE LINE BELOW*** to indicate where the
error is little help please.
If i add another call to the sheet calc inside the loop then i get overflow
errors.
The weird thing is the code still runs and still produces the correct output.
If you need to see the other functions this function calls just ask and ill
post them as well.

-snip-