vba - Why does addition give type mismatch even when I cast? -


i'm performing operations between 2 blocks of data separated blank row, , need row of second block. selecting top block of data using 'selection.end(xldown)' , taking row this, , adding 2 it. since there single blank row separate blocks, should work, on line add 2 row, type mismatch despite fact i'm casting row cint before add. code in question

dim col col = split(selection.address, "$")(1) dim tmp integer tmp = cint(col) + 2 

the last line of causes type mismatch error. why that? what's wrong cast i'm trying? importantly, how fix it?

i couldn't find encountering problem except pulling data sheet seemed different set of circumstances.

the way have set, you're returning character representation of address. try this:

col = selection.column 

which should return numeric position (in limited testing @ least)


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -