Body
When you have a column where the entered data in the first cell is the same data for the rest, you can create a button that will populate the rest of the cells in the column with the data from the first cell.
Example:
The code below is taking the data in the first cell of the Home Phone column and filling the rest of the cells in the column with the same phone number.
if(Button.clicked){
//if the first cell in the phone column is not empty
if(Phone[0].value !==null){
for (var i = 1; i < Name.value.length; i++ ) {
//fill all subsequent cells in phone column with data from first cell.
Phone[i].value = Phone[0].value;
}
// else if first cell is empty
} else {
//don't fill subsequent columns
Phone[i].value = null;
}
}
|