Forum Discussion

MattG's avatar
MattG
Copper Contributor
Dec 08, 2021

Get user input to use in an Excel Online Script

Hi

 

Does anyone know if it's possible to get user input to use as a variable with Excel Online Scripts?

 

I have hundreds of people using a workbook online and need to use their username to filter rows from clicking a button.

 

At the moment they have to type their username into a cell and the script will get that number, put it in a var (while replacing the cell contents with a blank, so that someone else can run the script).

 

Or, can the Excel Online Script access the username of the person that is using the excel online workbook?

 

Thanks,

Matt

2 Replies

    • JKPieterse's avatar
      JKPieterse
      Silver Contributor
      Alternatively, have the script clear the username cell at the end.
      Place a button next to that cell that triggers the script. The script checks if the cell contains something and if so, assumes the entry is the username. If the cell is empty, the script selects the cell, perhaps writes a prompt in the cell above it and ends.

Resources