vb.net - Type Mismatch Error, declaring Range Variable in Excel VBA -


this should simple fix, i've searched , searched , can't figure out wrong.

i'm getting "run-time error 13: type mismatch":

dim rng range     dim endrw integer, endcol integer endrw = 30 endcol = 10 set rng = sheets("sheet1").range(sheets("sheet1").cells(2,3),sheets("sheet1").cells(endrw,endcol))  

^^^ last line causing error ^^^^

try

set rng = sheets("sheet1").range(cells(2, 3), cells(endrw, endcol)) 

evidence.

enter image description here


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -