Below is a function which will return True or False if a valid IP address is entered. A valid IP address is of the form nnn.nnn.nnn.nnn where nnn >=0 and <=255

You can put following type of construct in a cell

=IsValidIP(A2)

1. Open your workbook and ALT+F11
2. Locate your Workbook name in Project Explorer Window
3. Right click on your workbook name > Insert > Module
4. Copy paste the Macro code given
5. Delete you Macro if the Macro was needed to be run only once.
6. Otherwise save your file as .xlsm if you intend to reuse Macro again.

The workbook related to this can be downloaded from Function_Valid_ IP_Address