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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -