Excel VBA run time error 1004 on Range object -
trying count whether or not present within grid in excel thats defined whether or not filled color or not (thats how boss wants formatted). not expert @ vba, , getting error in second line of loop. variables defined before this, , theres bunch of other stuff inside loop, i'm not including save space. i'm pretty sure problem evident here.
with thisworkbook.worksheets("core list") while not .range(cells(3, x)).value = "" 'while current name box isn't empty name1 = .range(cells(3, x)).value 'sets name in stat sheet thisworkbook.worksheets(stat).range(cells(4, x - 2)) = name1 loop end
if sheet code in not same "core list", need use .cells
, see:
with thisworkbook.worksheets("core list") while not .cells(3, x).value = "" 'while current name box isn't empty name1 = .cells(3, x).value 'sets name in stat sheet thisworkbook.worksheets(stat).cells(4, x - 2).value = name1 loop end
1 - don't need put cells
inside range
if want 1 cell. , if use cells
loose that, take cell sheet inserted code. if use .cells
, take sheet declared in with
block.
notice: if x
0 or lower, fail, there no column 0 in sheet. also, if it's big (i believe 256), blow limits of sheet.
Comments
Post a Comment