View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
KG Old Wolf KG Old Wolf is offline
external usenet poster
 
Posts: 19
Default Run time error 13 - type mismatch

Hi -

Nope - just relocated the "Error 13 - Type Mismatch" to the earlier line of
code:


RR_Count = Range("Table_Input").Offset(BB, 2)


(I had tried that and Integer to no avail but thank you for trying!)


=====================================

"Gary''s Student" wrote:

Early in the code:

Dim CC_Count as Long, RR_Count as Long

and then:

Offset(RR_Count, CC_Count)

should work
--
Gary''s Student - gsnu200905


"KG Old Wolf" wrote:

The code below works but I want to substitute the variables (RR_Count &
CC_Count) for the literals (25,0). I can confirm the correct numeric values
being obtained by the variables. Yet, as soon as I substitute the variables,
I get an error 13 - type mismatch. The values are always numerics and are
intended as displacement values for use by the offset.

I am still very new to VBA and may be missing something obvious. I tried DIM
RR_Count as Integer but that gave me a different error.

Thanks for any thoughts or suggestions...

================================================== ====

'
' Fill Output Detail Fields
'
For BB = 0 To 15 Step 1
'
' RR holds the ROW ID from the selected record in Table_Input
RR_Count = Range("Table_Input").Offset(BB, 2).Value
'
' CC holds the COLUMN ID from the selected record in Table_Input
CC_Count = Range("Table_Input").Offset(BB, 3).Value
'
'
Range("K1").Offset(25, 0).Value = Range("Table_Input").Offset(BB, 5).Value
'
'
'
Next BB