일요일, 26 March 2023
  2 답글
  3.5K 방문
0
투표
취소
Kutools는 이메일 주소의 이중 입력을 피하기 위해 Excel로 스프레드시트를 만들었습니다. 하지만 우리는 이 스프레드시트를 잃어버렸습니다. 제 질문은 이 동일한 매크로가 Google 스프레드시트에서 작동하도록 만들 수 있는지 여부입니다.
0
투표
취소
안녕,

죄송하지만 Excel에서 작동하는 매크로가 Google 스프레드시트에서는 작동하지 않습니다. Google 스프레드시트에서 다시 만들어야 합니다.

아만다
1 년 전
·
#3491
0
투표
취소
Kutools는 이메일 주소의 이중 입력을 피하기 위해 Excel로 스프레드시트를 만들었습니다. 하지만 우리는 이 스프레드시트를 잃어버렸습니다. 제 질문은 이 동일한 매크로가 Google 스프레드시트에서 작동하도록 만들 수 있는지 여부입니다.


Google 스프레드시트에서 이 VBA를 사용해 보세요.



function checkDuplicates() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
var emailCol = 2; // Replace 2 with the column number of the email column

var emails = {};
var duplicates = [];

// Loop through the data and check for duplicates
for (var i = 1; i < data.length; i++) {
var email = data[i][emailCol];

if (email && email !== "" && emails[email]) {
// Duplicate found
duplicates.push(i + 1); // Add row number to duplicates array
} else {
// Add email to hash table
emails[email] = true;
}
}

if (duplicates.length > 0) {
// Display error message
var message = "Duplicate email(s) found on row(s): " + duplicates.join(", ");
SpreadsheetApp.getUi().alert(message);
}
}


  • 페이지 :
  • 1
이 게시물에 대한 답변이 없습니다.