vba - Run-time Error '1004' - Method "Range' of Object' _ Global' failed -


i try find out in sheet using range.find:

sub grossmargin()  dim analysisyear integer analysisyear = 2015  worksheets(activesheet.index + 1).activate  set grossmarginloc = range("b1:b100").find("gross margin", , , , , , false) set grossmarginrow = range(grossmarginloc, grossmarginloc.offset(0, 20)) set bsayeartag = range("b1:b20").find("year", , , , , , false) set bsayearrow = range(bsayeartag, bsayeartag.offset(0, 20))  set bsayear = range(bsayearrow).find(analysisyear) '<-- here problem      debug.print bsayeartag.address debug.print bsayearrow.address debug.print grossmarginrow.address  worksheets(activesheet.index - 1).activate  end sub 

i getting run-time error '1004' - method "range' of object' _ global' failed when attempt run above code. problem appears line set bsayear = range(bsayearrow).find(analysisyear).

what causes error , how can avoid it?


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

Why does math.random(999999999999) returns 1 in Lua? -