excel - Calling sub with 2 parameters defined -
i trying call sub in main , fill column sub. getting syntax error. why this?
option explicit private sub form_load() dim mystring string, long, asciinum string, f long worksheets("sheet1") f = 2 .cells(.rows.count, "i").end(xlup).row mystring = .cells(f, "i").value2 prueba1 (mystring, f) next f end end sub sub prueba1(mystring, index long) dim long, asciinum string = 1 len(mystring) asciinum = lcase(mid(mystring, i, 1)) if asciinum "[aeiou]" .cells(index, "m") = "first vowel " + asciinum exit end if next end sub
prueba1 (mystring, f)
shouldprueba1 mystring, f
prueba1(mystring, index long)
shouldprueba1(mystring string, index long)
- there no parent worksheet in ... end in prueba1 using
.cells
instead ofcells
. @ minimum, shouldworksheets("sheet1").cells(index, "m") = "first vowel " + asciinum
Comments
Post a Comment