簡體   English   中英

如何在Google Spreadsheets中放置來自其他來源表的筆記

[英]How to place notes from different source sheet in Google Spreadsheets

我一直在努力尋找一種方法來將單元格(單元格范圍)中的信息作為注釋放置在不同工作表中的其他單元格(單元格范圍)中。

像這樣,如果我在Sheet1的A1單元格中有Apple,我希望將Apple作為注釋插入到Sheet 2的Cell F1中。

我試圖提出這樣的事情。

//I'm still working on this I have not been able to make this work//
//Ideally this will put the phone numbers as comment's in the needed cases//
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var targetsheet = ss.getSheetByName("report");
 var sourcesheet = ss.getSheetByName("Sheet1");
 var nrange = sourcesheet.getRange(2, 3, sourcesheet.getLastRow(), 1)
 var sourcenotes = [nrange.getValue()]
 var notes = targetsheet.getRange(2, 6, sourcesheet.getLastRow(),1)
 notes.setNotes(sourcenotes);

如您所見,這沒有用,我嘗試了不同的方法,但是沒有用,所以我向你們尋求幫助。

函數“ setNotes”采用二維數組,其值應類似於此setNotes([sourcenotes])。 檢查文檔

另外,如果您僅要為一個單元格設置注釋,我建議使用setNote函數。 是該函數的示例。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM