Array error in VBA -
dim scene(1 2) string dim currentsheet string scene(1) = "good" scene(2) = "better" currentsheet = scene(worksheets("input").cells(j, 1))
j
variable keeps on changing first column of input sheet has vales of 1 or 2 @ each row of currentsheet
there should either value of "good"
if worksheets("input").cells(j, 1)= 1
or "better"
if worksheets("input").cells(j, 1)=2
this gives me type mismatch , not able find out error have declared both scene
array , currentsheet
string.
try:
currentsheet = scene(cint(worksheets("input").cells(j, 1).value2))
if cell have "1" or "2" shouldn't make difference, index of array defined integer value - casting contents of cell integer should assist.
Comments
Post a Comment