I found a question asking a basically the same thing as me: https://www.mathworks.com/matlabcentral/answers/502430-search-through-an-excel-file-and-save-sheet-and-cells-as-variables?s_tid=prof_contriblnk
basically, this finds a user inputted string, and returnes the row in which that string is found.
this is the code I adapted from there:
in = input('Enter code: ', 's');[~,~,raw] = xlsread('examplesheet.xlsx');p = strcmp(in,raw);% Compare user input string with entries in the Excel sheet
rowNum = find(p==1)%Get Row number
this works for my purpose as well, with 1 caveat: it can only search the first sheet in an excel sheet. is there any way to get this to look through multiple sheets, and return the row and sheet name in 2 different variabvles? I have included an example sheet here.
Best Answer