excel - If function for cell contents -
i'm trying check if content range true, perform function.
sheets(1).[a1:a95] if .cells.value = "text" 'perform function end if end
but i'm getting type mismatch error. please.
if trying check each cell in range whatever testing then, try way.
dim ccell range each ccell in sheets(1).range("$a$1:$a$95") 'to test ensure ccell.value expect(can remove once working) debug.print ccell.value if ccell.value ="whateveryouwanttotestfor" 'call function here call myfunction end if next ccell
to test multiple values of ccell use select case
for each ccell in sheets(1).range("$a$1:$a$95") select case ccell.value case "text1" call text1function case "text2" call text2function 'do rest need end select next ccell
Comments
Post a Comment