Situation:
I have an spreadsheet and the same is modify by many users around 20, every min adding and following incident.
I have an script that add an Hyperlink into the column A.
Column (A) =HYPERLINK("https://www.example.com/id=12345";"12345")
Note: The Hyperlink appear for every row in the column A when I ingress the Ticket ID.
Problem:
When this script run and delete the information for the duplicate data, also clear the Hyperlink and then the Column A only have the data without the hyperlink.
Script delete the contents and not delete rows. Sometime delete the row and other only delete de data into the row.
For example:
row 10: data is Test1
row 11: data is Test1
row 12: data is Test3
When the script run sometime delete rows and the row 12 up to row 11. But other sometime only delete the contents in Row 11 and row 12 not move.
I needs this script do the following:
- Remove Duplicate rows.
- Is posible indicate in with Cell in a Boxmsg is the duplicate data?
- Not lost the hyperlink.
SCRIPT:
function removeDuplicates() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
var newData = new Array();
for(i in data){
var row = data[i];
var duplicate = false;
for(j in newData){
if(row[0] == newData[j][0]){
duplicate = true;
}
}
if(!duplicate){
newData.push(row);
}
}
sheet.clearContents();
sheet.getRange(1, 1, newData.length, newData[0].length).setValues(newData);
}
Thanks So Much.