excel - VBA Mis-Match Error 13 -
excel - VBA Mis-Match Error 13 -
i'm relatively new vba, wrote sub parse csv info contained in single cell , homecoming pieces of info other cells in spreadsheet. relatively simple code can't find error. err 13 mismatch on line moods = application.index(fullarray, 0, 3)
help appreciated.
private sub parsecsv() 'parse "notes" column , homecoming moods/keywords apropriate cells dim csv string dim fullarray variant dim lrow long dim keywords variant dim moods variant dim long lrow = activesheet().range("bl" & activesheet().rows.count).end(xlup).row = 3 lrow csv = activesheet.range("bl" & i) fullarray = split(csv, chr(10)) moods = application.index(fullarray, 0, 3) keywords = application.index(fullarray, 0, 2) activesheet.range("cd" & i).value = moods activesheet.range("ce" & i).value = keywords next end sub
i tested parse function below:
private sub parsecsvtest() 'parse "notes" column , homecoming moods/keywords apropriate cells dim csv string csv = activesheet.range("bl5") dim fullarray variant fullarray = split(csv, chr(10)) dim moods variant moods = application.index(fullarray, 0, 3) dim keywords variant keywords = application.index(fullarray, 0, 2) activesheet.range("cd5").value = moods activesheet.range("ce5").value = keywords end sub
works fine. tested loop.
private sub looptest() dim long dim lrow long lrow = activesheet().range("bl" & activesheet().rows.count).end(xlup).row = 3 lrow activesheet.range("cd" & i).value = "testing" next end sub
works fine. don't know go here.
you using csv before have assigned value it.
excel vba type-mismatch
Comments
Post a Comment