MATLAB: Is there a way to change the range function of xlsread based on a variable input

inputMATLABmatlab functionvariablesxlsread

What I want to do is to take values from a large excel file and using matlab create a text file.
Right now I have my code reading individual cell values and assigning them to a variable.
The variable is then input into a string of text using fprintf, as below,
fprintf(op, ' FIle Name : %s\n', sname);
Is there a way to take an input from a user that changes the range in the xlsread functions.
i.e. for the code below,
var = input('enter excel column: ', 's');
variable1 = xlsread('filename.xlsx', 'var4:var4');
variable2 = xlsread('filename.xlsx', 'var115:var115');
so that if, for example, a user input D
the function would read it as,
variable1 = xlsread('filename.xlsx', 'D4:D4');
variable2 = xlsread('filename.xlsx', 'D115:D115');

Best Answer

var = input('enter excel column: ', 's');
variable1 = xlsread('filename.xlsx', sprintf('%s4:%s4', var, var));
variable2 = xlsread('filename.xlsx', sprintf('%s115:%s115', var, var));