How do I import data from serial monitor to excel document without copying and pasting?
The Arduino IDE's serial monitor is just one of many tools that can open a serial port and collect information from it.

The first step is to make sure the data you are writing to the Serial object in the Arduino is in a format suitable for importing into Excel. Separate multiple values on one line with a comma "," or tab "\t" character.

If you are running windows, you can often just use the built-in type command from a command prompt to write the serial port to a file:

type COM4 &gt;&gt; log.txt


(Assuming the Arduino is on COM4 and you want to write the data to a file called log.txt.)

If you're on a Mac, open the Terminal app and type:

screen -L /dev/tty.usbmodem1441335 9600


(Assuming your Arduino is on serial port named tty.usbmodem1441335 and your port speed is 9600 bps.) The session will be written to a file called screenlog.0.

Then you can open the text/log file in Excel. If you rename it to end in .csv, that may also help Excel recognize it as tabular data.