स्प्रेडशीट की रेंज को ऐक्सेस और उनमें बदलाव कर सकता है. रेंज, किसी शीट में मौजूद एक सेल या शीट में मौजूद आस-पास की सेल का ग्रुप हो सकता है.
तरीके
| तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
|---|---|---|
activate() | Range | यह फ़ंक्शन, तय की गई रेंज को active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर बाईं ओर मौजूद सेल को current cell के तौर पर सेट करता है. |
activate | Range | यह फ़ंक्शन, तय की गई सेल को current cell के तौर पर सेट करता है. |
add | Range | यह फ़ंक्शन, रेंज में दी गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है. |
add | Range | यह फ़ंक्शन, रेंज में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है. |
add | Range | यह फ़ंक्शन, रेंज में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और वैल्यू शामिल होती है. |
add | Range | यह फ़ंक्शन, रेंज में डेवलपर मेटाडेटा जोड़ता है. इसके लिए, तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग का इस्तेमाल किया जाता है. |
apply | Banding | इस फ़ंक्शन की मदद से, रेंज में डिफ़ॉल्ट कॉलम बैंडिंग थीम लागू की जाती है. |
apply | Banding | यह फ़ंक्शन, रेंज में कॉलम बैंडिंग की तय की गई थीम लागू करता है. |
apply | Banding | यह फ़ंक्शन, हेडर और फ़ुटर की सेटिंग के साथ-साथ तय की गई रेंज में, कॉलम बैंडिंग की थीम लागू करता है. |
apply | Banding | यह फ़ंक्शन, रेंज में लाइन के हिसाब से डिफ़ॉल्ट थीम लागू करता है. |
apply | Banding | यह फ़ंक्शन, रेंज पर लाइन वाली थीम लागू करता है. |
apply | Banding | यह फ़ंक्शन, हेडर और फ़ुटर की दी गई सेटिंग के साथ, तय की गई रेंज में लाइनें डालने की थीम लागू करता है. |
auto | void | इस रेंज में मौजूद डेटा के आधार पर, destination में डेटा भरता है. |
auto | void | यह आस-पास की सेल के आधार पर, नई वैल्यू भरने के लिए एक रेंज का हिसाब लगाता है. साथ ही, इस रेंज में मौजूद डेटा के आधार पर, नई वैल्यू अपने-आप भर देता है. |
break | Range | रेंज में मौजूद एक से ज़्यादा कॉलम वाली सेल को फिर से अलग-अलग सेल में बांटें. |
can | Boolean | इस कुकी से यह तय होता है कि उपयोगकर्ता के पास रेंज में मौजूद हर सेल में बदलाव करने की अनुमति है या नहीं. |
check() | Range | इस फ़ंक्शन की मदद से, रेंज में मौजूद चेकबॉक्स की स्थिति को “चुना गया” में बदला जा सकता है. |
clear() | Range | इससे कॉन्टेंट और फ़ॉर्मैट की रेंज मिट जाती है. |
clear(options) | Range | इस विकल्प से, कॉन्टेंट, फ़ॉर्मैट, डेटा की पुष्टि करने के नियम, और/या टिप्पणियों की रेंज मिट जाती है. ऐसा, दिए गए बेहतर विकल्पों के हिसाब से होता है. |
clear | Range | इससे रेंज का कॉन्टेंट मिट जाता है. हालांकि, फ़ॉर्मैटिंग नहीं बदलती. |
clear | Range | इस फ़ंक्शन का इस्तेमाल करके, रेंज के लिए डेटा की पुष्टि करने के नियमों को हटाया जा सकता है. |
clear | Range | इससे इस रेंज के लिए फ़ॉर्मैटिंग हट जाती है. |
clear | Range | यह फ़ंक्शन, दी गई सेल या सेल में मौजूद नोट को मिटा देता है. |
collapse | Range | इससे रेंज में पूरी तरह से शामिल सभी ग्रुप छोटे हो जाते हैं. |
copy | void | रेंज की फ़ॉर्मैटिंग को दी गई जगह पर कॉपी करता है. |
copy | void | रेंज की फ़ॉर्मैटिंग को दी गई जगह पर कॉपी करता है. |
copy | void | यह फ़ंक्शन, सेल की किसी रेंज से डेटा को सेल की दूसरी रेंज में कॉपी करता है. |
copy | void | यह फ़ंक्शन, सेल की किसी रेंज से डेटा को सेल की दूसरी रेंज में कॉपी करता है. |
copy | void | यह फ़ंक्शन, सेल की किसी रेंज से डेटा को सेल की दूसरी रेंज में कॉपी करता है. |
copy | void | रेंज के कॉन्टेंट को दी गई जगह पर कॉपी करता है. |
copy | void | रेंज के कॉन्टेंट को दी गई जगह पर कॉपी करता है. |
create | Data | यह फ़ंक्शन, डेटा सोर्स से एक खाली डेटा सोर्स पिवट टेबल बनाता है. यह टेबल, इस रेंज की पहली सेल में ऐंकर की जाती है. |
create | Data | यह फ़ंक्शन, डेटा सोर्स से एक खाली डेटा सोर्स टेबल बनाता है. यह टेबल, इस रेंज के पहले सेल पर ऐंकर की जाती है. |
create | Developer | यह फ़ंक्शन, इस रेंज के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए DeveloperMetadataFinderApi ऑब्जेक्ट दिखाता है. |
create | Filter | यह फ़ंक्शन, फ़िल्टर बनाता है और उसे शीट पर मौजूद तय की गई रेंज पर लागू करता है. |
create | Pivot | इस फ़ंक्शन की मदद से, तय की गई रेंज की पहली सेल में ऐंकर की गई source से एक खाली पिवट टेबल बनाई जाती है. |
create | Text | यह फ़ंक्शन, रेंज के लिए टेक्स्ट फ़ाइंडर बनाता है. इसकी मदद से, इस रेंज में टेक्स्ट ढूंढा और बदला जा सकता है. |
delete | void | यह सेल की इस रेंज को मिटाता है. |
expand | Range | यह फ़ंक्शन, उन ग्रुप को बड़ा करता है जिनकी रेंज या कंट्रोल टॉगल, इस रेंज से इंटरसेक्ट करता है. |
getA1Notation() | String | यह फ़ंक्शन, A1 नोटेशन में रेंज की स्ट्रिंग के बारे में जानकारी देता है. |
get | String | यह फ़ंक्शन, रेंज (उदाहरण के लिए, '#ffffff') में सबसे ऊपर मौजूद बाएं सेल के बैकग्राउंड का रंग दिखाता है. |
get | Color | यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के बैकग्राउंड का रंग दिखाता है. |
get | Color[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के बैकग्राउंड के रंग दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के बैकग्राउंड के रंग दिखाता है. उदाहरण के लिए, '#ffffff'. |
get | Banding[] | इस फ़ंक्शन से, इस रेंज में मौजूद किसी भी सेल पर लागू की गई सभी बैंडिंग मिलती हैं. |
get | Range | यह फ़ंक्शन, किसी रेंज में मौजूद सेल की जानकारी देता है. |
get | Integer | यह फ़ंक्शन, इस रेंज के लिए शुरुआती कॉलम की पोज़िशन दिखाता है. |
get | Range | यह फ़ंक्शन, रेंज की एक कॉपी दिखाता है. इस कॉपी में, रेंज को चारों दिशाओं Direction में बढ़ाया जाता है, ताकि डेटा वाले सभी आस-पास के सेल शामिल किए जा सकें. |
get | Range | अगर तय किया गया डाइमेंशन Dimension.ROWS है, तो यह फ़ंक्शन, Direction.UP और Direction.DOWN को बड़ा करके रेंज की कॉपी दिखाता है. अगर डाइमेंशन Dimension.COLUMNS है, तो यह फ़ंक्शन, Direction.NEXT और Direction.PREVIOUS को बड़ा करके रेंज की कॉपी दिखाता है. |
get | Data | यह फ़ंक्शन, रेंज में मौजूद पहली सेल के लिए Data वैल्यू दिखाता है. अगर सेल में डेटा सोर्स का फ़ॉर्मूला नहीं है, तो यह null वैल्यू दिखाता है. |
get | Data | यह फ़ंक्शन, रेंज में मौजूद सेल के लिए Data दिखाता है. |
get | Data | इस फ़ंक्शन से, रेंज से इंटरसेक्ट करने वाली सभी डेटा सोर्स पिवट टेबल मिलती हैं. |
get | Data | इस फ़ंक्शन से, रेंज के साथ इंटरसेक्ट करने वाली सभी डेटा सोर्स टेबल मिलती हैं. |
get | String | यह फ़ंक्शन, इस रेंज में मौजूद डेटा के लिए यूआरएल दिखाता है. इसका इस्तेमाल चार्ट और क्वेरी बनाने के लिए किया जा सकता है. |
get | Data | इस ऑब्जेक्ट में मौजूद डेटा को DataTable के तौर पर दिखाएं. |
get | Data | इस रेंज में मौजूद डेटा को DataTable के तौर पर दिखाएं. |
get | Data | यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए, डेटा की पुष्टि करने का नियम दिखाता है. |
get | Data | यह फ़ंक्शन, रेंज में मौजूद सभी सेल के लिए डेटा की पुष्टि करने के नियम दिखाता है. |
get | Developer | इस रेंज से जुड़ा डेवलपर मेटाडेटा मिलता है. |
get | String | इस फ़ंक्शन से, रेंज में सबसे ऊपर मौजूद बाएं सेल की दिखाई गई वैल्यू मिलती है. |
get | String[][] | यह फ़ंक्शन, इस रेंज के लिए वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है. |
get | Filter|null | यह फ़ंक्शन, उस शीट पर मौजूद फ़िल्टर दिखाता है जिससे यह रेंज जुड़ी है. अगर शीट पर कोई फ़िल्टर नहीं है, तो यह null दिखाता है. |
get | Color | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने में मौजूद सेल के फ़ॉन्ट का रंग दिखाता है. |
get | Color[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट के रंग दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल की फ़ॉन्ट फ़ैमिली दिखाता है. |
get | String | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल की फ़ॉन्ट फ़ैमिली दिखाता है. |
get | String | इस फ़ंक्शन से, रेंज के सबसे ऊपर बाईं ओर मौजूद सेल ('underline', 'line-through' या 'none') की लाइन स्टाइल मिलती है. |
get | String[][] | इस फ़ंक्शन से, रेंज में मौजूद सेल की लाइन स्टाइल ('underline', 'line-through' या 'none') मिलती है. |
get | Integer | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल के फ़ॉन्ट का साइज़ पॉइंट में दिखाता है. |
get | Integer[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट साइज़ दिखाता है. |
get | String | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल के फ़ॉन्ट का स्टाइल ('italic' या 'normal') दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट स्टाइल दिखाता है. |
get | String | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल के फ़ॉन्ट का वेट (सामान्य/बोल्ड) दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट वेट दिखाता है. |
get | String | यह फ़ंक्शन, रेंज की सबसे ऊपर बाईं ओर मौजूद सेल के लिए फ़ॉर्मूला (A1 नोटेशन) दिखाता है. अगर सेल खाली है या उसमें कोई फ़ॉर्मूला नहीं है, तो यह फ़ंक्शन एक खाली स्ट्रिंग दिखाता है. |
get | String | किसी सेल के लिए फ़ॉर्मूला (R1C1 नोटेशन) दिखाता है. अगर कोई फ़ॉर्मूला नहीं है, तो null दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के लिए फ़ॉर्मूले (A1 नोटेशन) दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के लिए फ़ॉर्मूले (R1C1 नोटेशन) दिखाता है. |
get | Integer | यह फ़ंक्शन, रेंज की पैरंट शीट का ग्रिड आईडी दिखाता है. |
get | Integer | यह फ़ंक्शन, रेंज की ऊंचाई दिखाता है. |
get | String | यह फ़ंक्शन, रेंज के सबसे ऊपर बाएं कोने में मौजूद सेल के टेक्स्ट का हॉरिज़ॉन्टल अलाइनमेंट (बाएं/बीच/दाएं) दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के हॉरिज़ॉन्टल अलाइनमेंट दिखाता है. |
get | Integer | यह फ़ंक्शन, आखिरी कॉलम की पोज़िशन दिखाता है. |
get | Integer | आखिरी लाइन की पोज़िशन दिखाता है. |
get | Range[] | यह फ़ंक्शन, Range ऑब्जेक्ट की एक ऐसी कलेक्शन दिखाता है जिसमें मर्ज की गई सेल शामिल होती हैं. ये सेल या तो पूरी तरह से मौजूदा रेंज में होती हैं या इनमें से कम से कम एक सेल मौजूदा रेंज में होती है. |
get | Range | यह फ़ंक्शन, रेंज के पहले कॉलम और पहली लाइन में मौजूद सेल से शुरू होकर, दी गई दिशा में मौजूद अगली सेल दिखाता है. यह सेल, डेटा वाली सेल की लगातार रेंज का किनारा होती है या उस दिशा में स्प्रेडशीट के किनारे पर मौजूद सेल होती है. |
get | String | यह फ़ंक्शन, दी गई रेंज से जुड़ा नोट दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल से जुड़े नोट दिखाता है. |
get | Integer | यह फ़ंक्शन, इस रेंज में मौजूद कॉलम की संख्या दिखाता है. |
get | Integer | यह फ़ंक्शन, इस रेंज में मौजूद पंक्तियों की संख्या दिखाता है. |
get | String | इस फ़ंक्शन की मदद से, दी गई रेंज की सबसे ऊपर बाईं ओर मौजूद सेल की संख्या या तारीख की फ़ॉर्मैटिंग मिलती है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के लिए संख्या या तारीख के फ़ॉर्मैट दिखाता है. |
get | Rich | यह फ़ंक्शन, रेंज की सबसे ऊपर बाईं ओर मौजूद सेल के लिए रिच टेक्स्ट वैल्यू दिखाता है. अगर सेल की वैल्यू टेक्स्ट नहीं है, तो यह null दिखाता है. |
get | Rich | यह फ़ंक्शन, रेंज में मौजूद सेल के लिए रिच टेक्स्ट वैल्यू दिखाता है. |
get | Integer | इस फ़ंक्शन से, इस रेंज के लिए लाइन की पोज़िशन मिलती है. |
get | Integer | इस फ़ंक्शन से, इस रेंज के लिए लाइन की पोज़िशन मिलती है. |
get | Sheet | यह फ़ंक्शन, उस शीट को दिखाता है जिससे यह रेंज जुड़ी है. |
get | Text | यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए टेक्स्ट की दिशा दिखाता है. |
get | Text | इस फ़ंक्शन की मदद से, रेंज में मौजूद सेल के लिए टेक्स्ट की दिशाएं मिलती हैं. |
get | Text | यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए टेक्स्ट रोटेशन की सेटिंग दिखाता है. |
get | Text | इस फ़ंक्शन की मदद से, रेंज में मौजूद सेल के लिए टेक्स्ट रोटेशन की सेटिंग मिलती हैं. |
get | Text | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं सेल के टेक्स्ट स्टाइल को दिखाता है. |
get | Text | यह फ़ंक्शन, रेंज में मौजूद सेल के लिए टेक्स्ट स्टाइल दिखाता है. |
get | Object | यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल की वैल्यू दिखाता है. |
get | Object[][] | यह फ़ंक्शन, इस रेंज के लिए वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है. |
get | String | यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाली सेल का वर्टिकल अलाइनमेंट (सबसे ऊपर/बीच में/सबसे नीचे) दिखाता है. |
get | String[][] | यह फ़ंक्शन, रेंज में मौजूद सेल के वर्टिकल अलाइनमेंट दिखाता है. |
get | Integer | यह फ़ंक्शन, कॉलम में मौजूद रेंज की चौड़ाई दिखाता है. |
get | Boolean | इससे यह पता चलता है कि सेल में मौजूद टेक्स्ट रैप होता है या नहीं. |
get | Wrap | इस फ़ंक्शन की मदद से, रेंज में मौजूद सेल के लिए टेक्स्ट रैपिंग की रणनीतियां मिलती हैं. |
get | Wrap | यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए टेक्स्ट रैपिंग की रणनीति दिखाता है. |
get | Boolean[][] | इससे यह पता चलता है कि सेल में मौजूद टेक्स्ट रैप होता है या नहीं. |
insert | Range | इस रेंज में खाली सेल जोड़ता है. |
insert | Range | यह फ़ंक्शन, रेंज में मौजूद हर सेल में चेकबॉक्स डालता है. इन चेकबॉक्स को इस तरह कॉन्फ़िगर किया जाता है कि चुने गए चेकबॉक्स के लिए true और नहीं चुने गए चेकबॉक्स के लिए false दिखे. |
insert | Range | यह फ़ंक्शन, रेंज की हर सेल में चेकबॉक्स डालता है. इसमें, चुने गए चेकबॉक्स के लिए कस्टम वैल्यू और नहीं चुने गए चेकबॉक्स के लिए खाली स्ट्रिंग कॉन्फ़िगर की जाती है. |
insert | Range | यह फ़ंक्शन, रेंज की हर सेल में चेकबॉक्स डालता है. इन चेकबॉक्स को, चुने गए और नहीं चुने गए स्टेटस के लिए कस्टम वैल्यू के साथ कॉन्फ़िगर किया जाता है. |
is | Boolean | अगर रेंज पूरी तरह से खाली है, तो true दिखाता है. |
is | Boolean | यह फ़ंक्शन बताता है कि रेंज में मौजूद सभी सेल में चेकबॉक्स की स्थिति 'चुना गया' के तौर पर सेट है या नहीं. |
is | Boolean | इससे यह तय होता है कि रेंज का आखिरी हिस्सा किसी कॉलम से जुड़ा है या नहीं. |
is | Boolean | इससे यह तय किया जाता है कि रेंज का आखिरी हिस्सा किसी खास लाइन से जुड़ा है या नहीं. |
is | Boolean | अगर मौजूदा रेंज में मौजूद सेल, मर्ज की गई किसी सेल से ओवरलैप होती हैं, तो true दिखाता है. |
is | Boolean | इस विकल्प से यह तय होता है कि रेंज की शुरुआत किसी कॉलम से जुड़ी है या नहीं. |
is | Boolean | इससे यह तय होता है कि रेंज की शुरुआत किसी खास लाइन से जुड़ी है या नहीं. |
merge() | Range | यह फ़ंक्शन, रेंज में मौजूद सेल को एक साथ मिलाकर एक ब्लॉक बना देता है. |
merge | Range | रेंज के कॉलम में मौजूद सेल को मर्ज करता है. |
merge | Range | यह फ़ंक्शन, रेंज में मौजूद सेल को एक साथ मर्ज करता है. |
move | void | इस रेंज से टारगेट रेंज में, कट और चिपकाएं. इसमें फ़ॉर्मैट और वैल्यू, दोनों शामिल हैं. |
offset(rowOffset, columnOffset) | Range | यह फ़ंक्शन, एक नई रेंज दिखाता है. यह रेंज, दी गई पंक्तियों और कॉलम की संख्या के हिसाब से इस रेंज से ऑफ़सेट होती है. पंक्तियों और कॉलम की संख्या नेगेटिव भी हो सकती है. |
offset(rowOffset, columnOffset, numRows) | Range | यह फ़ंक्शन, मौजूदा रेंज के हिसाब से एक नई रेंज दिखाता है. इस नई रेंज का सबसे ऊपर मौजूद बायां पॉइंट, मौजूदा रेंज से दी गई पंक्तियों और कॉलम के हिसाब से ऑफ़सेट होता है. साथ ही, इसकी ऊंचाई, सेल में दी गई ऊंचाई के बराबर होती है. |
offset(rowOffset, columnOffset, numRows, numColumns) | Range | यह फ़ंक्शन, मौजूदा रेंज के हिसाब से एक नई रेंज दिखाता है. इस नई रेंज का ऊपरी-बायां कोना, मौजूदा रेंज से दी गई पंक्तियों और कॉलम के हिसाब से ऑफ़सेट होता है. साथ ही, इसकी ऊंचाई और चौड़ाई, सेल में दी गई ऊंचाई और चौड़ाई के हिसाब से होती है. |
protect() | Protection | यह एक ऐसा ऑब्जेक्ट बनाता है जो रेंज को उन उपयोगकर्ताओं के अलावा किसी और से बदलाव करने से सुरक्षित रख सकता है जिनके पास अनुमति है. |
randomize() | Range | यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों के क्रम को रैंडम तरीके से बदलता है. |
remove | Range | इस फ़ंक्शन की मदद से, रेंज से सभी चेकबॉक्स हटाए जाते हैं. |
remove | Range | इस रेंज में मौजूद उन लाइनों को हटाता है जिनमें ऐसी वैल्यू होती हैं जो किसी पिछली लाइन में मौजूद वैल्यू की डुप्लीकेट होती हैं. |
remove | Range | इस रेंज में मौजूद उन लाइनों को हटाता है जिनमें बताए गए कॉलम में ऐसी वैल्यू मौजूद होती हैं जो किसी पिछली लाइन में मौजूद वैल्यू की डुप्लीकेट होती हैं. |
set | Range | इस विकल्प से, सीएसएस नोटेशन में रेंज की सभी सेल के बैकग्राउंड का रंग सेट किया जाता है. जैसे, '#ffffff'
या 'white'. |
set | Range | इस विकल्प का इस्तेमाल करके, रेंज में मौजूद सभी सेल के बैकग्राउंड का रंग सेट किया जाता है. |
set | Range | बैकग्राउंड के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इस विकल्प का इस्तेमाल करके, आरजीबी वैल्यू (0 से 255 के बीच के पूर्णांक) का इस्तेमाल करके, बैकग्राउंड को दिए गए रंग पर सेट किया जाता है. |
set | Range | बैकग्राउंड के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | बॉर्डर प्रॉपर्टी सेट करता है. |
set | Range | इस विकल्प की मदद से, बॉर्डर की प्रॉपर्टी को रंग और/या स्टाइल के साथ सेट किया जाता है. |
set | Range | यह फ़ंक्शन, रेंज में मौजूद सभी सेल के लिए डेटा की पुष्टि करने का एक नियम सेट करता है. |
set | Range | यह फ़ंक्शन, रेंज में मौजूद सभी सेल के लिए डेटा की पुष्टि करने के नियम सेट करता है. |
set | Range | इससे सीएसएस नोटेशन (जैसे कि '#ffffff' या 'white') में फ़ॉन्ट का रंग सेट किया जाता है. |
set | Range | इससे दी गई रेंज के फ़ॉन्ट का रंग सेट किया जाता है. |
set | Range | यह फ़ॉन्ट के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | यह फ़ॉन्ट के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इससे फ़ॉन्ट फ़ैमिली की आयताकार ग्रिड सेट की जाती है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इससे फ़ॉन्ट फ़ैमिली सेट की जाती है. जैसे, "Arial" या "Helvetica". |
set | Range | यह दिए गए रेंज ('underline', 'line-through' या 'none') के फ़ॉन्ट की लाइन स्टाइल सेट करता है. |
set | Range | लाइन स्टाइल की आयताकार ग्रिड सेट करता है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इससे फ़ॉन्ट का साइज़ सेट किया जाता है. साइज़, इस्तेमाल किया जाने वाला पॉइंट साइज़ होता है. |
set | Range | इससे फ़ॉन्ट साइज़ की आयताकार ग्रिड सेट की जाती है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | दी गई रेंज ('italic' या 'normal') के लिए फ़ॉन्ट स्टाइल सेट करें. |
set | Range | इससे फ़ॉन्ट स्टाइल की आयताकार ग्रिड सेट की जाती है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | दी गई रेंज के लिए फ़ॉन्ट वेट (सामान्य/बोल्ड) सेट करता है. |
set | Range | इससे फ़ॉन्ट वेट की रेक्टेंगुलर ग्रिड सेट की जाती है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इस रेंज के लिए फ़ॉर्मूला अपडेट करता है. |
set | Range | इस रेंज के लिए फ़ॉर्मूला अपडेट करता है. |
set | Range | फ़ॉर्मूलों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | फ़ॉर्मूलों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | दी गई रेंज के लिए, हॉरिज़ॉन्टल (बाएं से दाएं) अलाइनमेंट (बाएं/बीच में/दाएं) सेट करता है. |
set | Range | यह विकल्प, हॉरिज़ॉन्टल अलाइनमेंट की रेक्टैंगुलर ग्रिड सेट करता है. |
set | Range | नोट को दी गई वैल्यू पर सेट करता है. |
set | Range | नोट की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इस विकल्प का इस्तेमाल करके, नंबर या तारीख के फ़ॉर्मैट को दी गई फ़ॉर्मैटिंग स्ट्रिंग के हिसाब से सेट किया जाता है. |
set | Range | यह फ़ंक्शन, नंबर या तारीख के फ़ॉर्मैट की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इस फ़ंक्शन का इस्तेमाल करके, रेंज में मौजूद सेल के लिए रिच टेक्स्ट वैल्यू सेट की जाती है. |
set | Range | इससे रिच टेक्स्ट वैल्यू की आयताकार ग्रिड सेट की जाती है. |
set | Range | इससे यह सेट होता है कि रेंज में हाइपरलिंक दिखाए जाने चाहिए या नहीं. |
set | Range | इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट की दिशा सेट की जाती है. |
set | Range | इससे टेक्स्ट की दिशाओं का आयताकार ग्रिड सेट किया जाता है. |
set | Range | इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट रोटेशन की सेटिंग सेट की जाती हैं. |
set | Range | इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट रोटेशन की सेटिंग सेट की जाती हैं. |
set | Range | इससे टेक्स्ट रोटेशन की आयताकार ग्रिड सेट की जाती है. |
set | Range | इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट स्टाइल सेट की जाती है. |
set | Range | इससे टेक्स्ट स्टाइल का आयताकार ग्रिड सेट किया जाता है. |
set | Range | इस विकल्प का इस्तेमाल करके, रेंज की वैल्यू सेट की जाती है. |
set | Range | वैल्यू की आयताकार ग्रिड सेट करता है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | दी गई रेंज के लिए, वर्टिकल (ऊपर से नीचे) अलाइनमेंट सेट करें (ऊपर/बीच में/नीचे). |
set | Range | वर्टिकल अलाइनमेंट की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
set | Range | इस विकल्प से यह सेट किया जाता है कि रेंज में मौजूद सेल के टेक्स्ट को स्टैक करना है या नहीं. |
set | Range | इस फ़ंक्शन का इस्तेमाल करके, दी गई रेंज के सेल रैप को सेट किया जाता है. |
set | Range | यह रैप करने की रणनीतियों की आयताकार ग्रिड सेट करता है. |
set | Range | इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट रैपिंग की रणनीति सेट की जाती है. |
set | Range | इससे टेक्स्ट रैप करने की नीतियों की आयताकार ग्रिड सेट की जाती है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए. |
shift | Range | यह फ़ंक्शन, तय की गई रकम के हिसाब से रेंज के कॉलम ग्रुपिंग की डेप्थ को बदलता है. |
shift | Range | यह फ़ंक्शन, तय की गई संख्या के हिसाब से रेंज की लाइन ग्रुपिंग की डेप्थ बदलता है. |
sort(sortSpecObj) | Range | यह फ़ंक्शन, दी गई रेंज में मौजूद सेल को तय किए गए कॉलम और क्रम के हिसाब से क्रमबद्ध करता है. |
split | void | यह फ़ंक्शन, टेक्स्ट वाले कॉलम को कई कॉलम में बांटता है. यह काम, अपने-आप पता लगाए गए डेलिमिटर के आधार पर किया जाता है. |
split | void | इस फ़ंक्शन की मदद से, टेक्स्ट के किसी कॉलम को कई कॉलम में बांटा जा सकता है. इसके लिए, तय की गई स्ट्रिंग को कस्टम डेलिमिटर के तौर पर इस्तेमाल किया जाता है. |
split | void | यह फ़ंक्शन, टेक्स्ट वाले कॉलम को तय किए गए डेलिमिटर के आधार पर कई कॉलम में बांटता है. |
trim | Range | यह फ़ंक्शन, इस रेंज की हर सेल में मौजूद खाली जगह (जैसे कि स्पेस, टैब या नई लाइनें) को हटाता है. |
uncheck() | Range | इस फ़ंक्शन की मदद से, रेंज में मौजूद चेकबॉक्स की स्थिति को “unchecked” में बदला जा सकता है. |
ज़्यादा जानकारी वाला दस्तावेज़
activate()
यह फ़ंक्शन, तय की गई रेंज को active range के तौर पर सेट करता है. साथ ही, रेंज में सबसे ऊपर बाईं ओर मौजूद सेल को current cell के तौर पर सेट करता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getRange('A1:D10'); range.activate(); const selection = sheet.getSelection(); // Current cell: A1 const currentCell = selection.getCurrentCell(); // Active Range: A1:D10 const activeRange = selection.getActiveRange();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
activateAsCurrentCell()
यह फ़ंक्शन, तय की गई सेल को current cell के तौर पर सेट करता है.
अगर बताई गई सेल, किसी मौजूदा रेंज में मौजूद है, तो वह रेंज, मौजूदा रेंज बन जाती है. साथ ही, सेल को मौजूदा सेल के तौर पर सेट कर दिया जाता है.
अगर दी गई सेल किसी मौजूदा रेंज में मौजूद नहीं है, तो मौजूदा रेंज हटा दी जाती है. साथ ही, सेल को मौजूदा सेल और ऐक्टिव रेंज बना दिया जाता है.
ध्यान दें: बताया गया Range एक सेल का होना चाहिए. ऐसा न होने पर, यह फ़ंक्शन एक अपवाद दिखाता है.
// Gets the first sheet of the spreadsheet. const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // Gets the cell B5 and sets it as the active cell. const range = sheet.getRange('B5'); const currentCell = range.activateAsCurrentCell(); // Logs the activated cell. console.log(currentCell.getA1Notation());
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key)
यह फ़ंक्शन, रेंज में दी गई कुंजी के साथ डेवलपर मेटाडेटा जोड़ता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 on the sheet. const range = sheet.getRange('2:2'); // Adds the key 'NAME' to the developer metadata for row 2. range.addDeveloperMetadata('NAME'); // Gets the metadata and logs it to the console. const developerMetaData = range.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key, visibility)
यह फ़ंक्शन, रेंज में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और दिखने की सेटिंग होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 on Sheet1. const range = sheet.getRange('2:2'); // Adds the key 'NAME' and sets the developer metadata visibility to 'DOCUMENT' // for row 2 on Sheet1. range.addDeveloperMetadata( 'NAME', SpreadsheetApp.DeveloperMetadataVisibility.DOCUMENT, ); // Gets the updated metadata info and logs it to the console. const developerMetaData = range.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getVisibility().toString());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
visibility | Developer | नए डेवलपर मेटाडेटा के दिखने की स्थिति. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key, value)
यह फ़ंक्शन, रेंज में डेवलपर मेटाडेटा जोड़ता है. इसमें तय की गई कुंजी और वैल्यू शामिल होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 of Sheet1. const range = sheet.getRange('2:2'); // Adds the key 'NAME' and sets the value to 'GOOGLE' for the metadata of row 2. range.addDeveloperMetadata('NAME', 'GOOGLE'); // Gets the metadata and logs it to the console. const developerMetaData = range.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
addDeveloperMetadata(key, value, visibility)
यह फ़ंक्शन, रेंज में डेवलपर मेटाडेटा जोड़ता है. इसके लिए, तय की गई कुंजी, वैल्यू, और दिखने की सेटिंग का इस्तेमाल किया जाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 on the sheet. const range = sheet.getRange('2:2'); // Adds the key 'NAME', sets the value to 'GOOGLE', and sets the visibility // to PROJECT for row 2 on the sheet. range.addDeveloperMetadata( 'NAME', 'GOOGLE', SpreadsheetApp.DeveloperMetadataVisibility.PROJECT, ); // Gets the updated metadata info and logs it to the console. const developerMetaData = range.getDeveloperMetadata()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue()); console.log(developerMetaData.getVisibility().toString());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
key | String | नए डेवलपर मेटाडेटा के लिए कुंजी. |
value | String | नए डेवलपर मेटाडेटा की वैल्यू. |
visibility | Developer | नए डेवलपर मेटाडेटा के दिखने की स्थिति. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
applyColumnBanding()
इस फ़ंक्शन की मदद से, रेंज में डिफ़ॉल्ट कॉलम बैंडिंग थीम लागू की जाती है. डिफ़ॉल्ट रूप से, बैंडिंग में हेडर होता है और फ़ुटर का रंग नहीं होता.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 on the sheet. const range = sheet.getRange('2:2'); // Applies column banding to row 2. const colBanding = range.applyColumnBanding(); // Gets the first banding on the sheet and logs the color of the header column. console.log( sheet.getBandings()[0] .getHeaderColumnColorObject() .asRgbColor() .asHexString(), ); // Gets the first banding on the sheet and logs the color of the second column. console.log( sheet.getBandings()[0] .getSecondColumnColorObject() .asRgbColor() .asHexString(), );
वापसी का टिकट
Banding — नई बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
applyColumnBanding(bandingTheme)
यह फ़ंक्शन, रेंज में कॉलम बैंडिंग की तय की गई थीम लागू करता है. डिफ़ॉल्ट रूप से, बैंडिंग में हेडर होता है और फ़ुटर का रंग नहीं होता.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 on the sheet. const range = sheet.getRange('2:2'); // Applies the INDIGO color banding theme to the columns in row 2. const colBanding = range.applyColumnBanding(SpreadsheetApp.BandingTheme.INDIGO); // Gets the first banding on the sheet and logs the color of the second column. console.log( sheet.getBandings()[0] .getSecondColumnColorObject() .asRgbColor() .asHexString(), );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
banding | Banding | रंग की थीम, जिसे रेंज में मौजूद कॉलम पर लागू करना है. |
वापसी का टिकट
Banding — नई बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
applyColumnBanding(bandingTheme, showHeader, showFooter)
यह फ़ंक्शन, हेडर और फ़ुटर की सेटिंग के साथ-साथ तय की गई रेंज में, कॉलम बैंडिंग की थीम लागू करता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets rows 12-22 on the sheet. const range = sheet.getRange('12:22'); // Applies the BLUE color banding theme to rows 12-22. // Sets the header visibility to false and the footer visibility to true. const colBanding = range.applyColumnBanding( SpreadsheetApp.BandingTheme.BLUE, false, true, ); // Gets the banding color and logs it to the console. console.log( sheet.getBandings()[0] .getSecondColumnColorObject() .asRgbColor() .asHexString(), ); // Gets the header color object and logs it to the console. Returns null because // the header visibility is set to false. console.log(sheet.getBandings()[0].getHeaderColumnColorObject()); // Gets the footer color and logs it to the console. console.log( sheet.getBandings()[0] .getFooterColumnColorObject() .asRgbColor() .asHexString(), );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
banding | Banding | रंग की थीम, जिसे रेंज में मौजूद कॉलम पर लागू करना है. |
show | Boolean | अगर true है, तो बैंडिंग थीम के हेडर का रंग, पहले कॉलम पर लागू होता है. |
show | Boolean | अगर true है, तो बैंडिंग थीम के फ़ुटर का रंग, आखिरी कॉलम पर लागू होता है. |
वापसी का टिकट
Banding — नई बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
applyRowBanding()
यह फ़ंक्शन, रेंज में लाइन के हिसाब से डिफ़ॉल्ट थीम लागू करता है. डिफ़ॉल्ट रूप से, बैंडिंग में हेडर होता है और फ़ुटर का रंग नहीं होता.
// Opens the spreadsheet by its URL. If you created your script from within a // Google Sheets spreadsheet, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets rows 1-30 on Sheet1. const range = sheet.getRange('1:30'); // Applies row banding to rows 1-30. range.applyRowBanding(); // Gets the hex color of the second banded row. const secondRowColor = range.getBandings()[0].getSecondRowColorObject().asRgbColor().asHexString(); // Logs the hex color to console. console.log(secondRowColor);
वापसी का टिकट
Banding — बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
applyRowBanding(bandingTheme)
यह फ़ंक्शन, रेंज पर लाइन वाली थीम लागू करता है. डिफ़ॉल्ट रूप से, बैंडिंग में हेडर होता है और फ़ुटर का रंग नहीं होता.
// Opens the spreadsheet by its URL. If you created your script from within a // Google Sheets spreadsheet, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets rows 1-30 on Sheet1. const range = sheet.getRange('1:30'); // Applies the INDIGO row banding theme to rows 1-30. range.applyRowBanding(SpreadsheetApp.BandingTheme.INDIGO); // Gets the hex color of the second banded row. const secondRowColor = range.getBandings()[0].getSecondRowColorObject().asRgbColor().asHexString(); // Logs the hex color to console. console.log(secondRowColor);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
banding | Banding | रंग की थीम, जिसे रेंज में मौजूद लाइनों पर लागू करना है. |
वापसी का टिकट
Banding — नई बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
applyRowBanding(bandingTheme, showHeader, showFooter)
यह फ़ंक्शन, हेडर और फ़ुटर की दी गई सेटिंग के साथ, तय की गई रेंज में लाइनें डालने की थीम लागू करता है.
// Opens the spreadsheet by its URL. If you created your script from within a // Google Sheets spreadsheet, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets rows 1-30 on Sheet1. const range = sheet.getRange('1:30'); // Applies the INDIGO row banding to rows 1-30 and // specifies to hide the header and show the footer. range.applyRowBanding(SpreadsheetApp.BandingTheme.INDIGO, false, true);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
banding | Banding | रंग की थीम, जिसे रेंज में मौजूद लाइनों पर लागू करना है. |
show | Boolean | अगर true है, तो बैंडिंग थीम के हेडर का रंग पहली लाइन पर लागू होता है. |
show | Boolean | अगर true है, तो बैंडिंग थीम के फ़ुटर का रंग आखिरी लाइन पर लागू होता है. |
वापसी का टिकट
Banding — नई बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
autoFill(destination, series)
इस रेंज में मौजूद डेटा के आधार पर, destinationRange में डेटा भरता है. नई वैल्यू भी, तय किए गए series टाइप के हिसाब से तय की जाती हैं. डेस्टिनेशन रेंज में यह रेंज शामिल होनी चाहिए. साथ ही, इसे सिर्फ़ एक दिशा में बढ़ाया जाना चाहिए. उदाहरण के लिए, यहां A1:A20 में मौजूद मौजूदा वैल्यू के आधार पर, A1:A4 में बढ़ती हुई संख्याओं की सीरीज़ भरी जाती है:
const sheet = SpreadsheetApp.getActiveSheet(); // Has values [1, 2, 3, 4]. const sourceRange = sheet.getRange('A1:A4'); // The range to fill with values. const destination = sheet.getRange('A1:A20'); // Inserts new values in A5:A20, continuing the pattern expressed in A1:A4 sourceRange.autoFill(destination, SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
destination | Range | वह रेंज जिसमें वैल्यू अपने-आप भरी जाएंगी. डेस्टिनेशन रेंज में यह रेंज शामिल होनी चाहिए. साथ ही, इसे सिर्फ़ एक दिशा में बढ़ाया जाना चाहिए (ऊपर, नीचे, बाएं या दाएं). |
series | Auto | ऑटोमैटिक भरने की सुविधा वाली सीरीज़ का वह टाइप जिसका इस्तेमाल नई वैल्यू का हिसाब लगाने के लिए किया जाना चाहिए. इस सीरीज़ का असर, सोर्स डेटा के टाइप और उसकी मात्रा के आधार पर अलग-अलग होता है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
autoFillToNeighbor(series)
यह आस-पास की सेल के आधार पर, नई वैल्यू भरने के लिए एक रेंज का हिसाब लगाता है. साथ ही, इस रेंज में मौजूद डेटा के आधार पर, नई वैल्यू अपने-आप भर देता है. इन नई वैल्यू को भी, बताई गई series टाइप के हिसाब से तय किया जाता है.
डेस्टिनेशन रेंज का हिसाब लगाते समय, आस-पास के डेटा को ध्यान में रखा जाता है. इससे यह तय किया जाता है कि नई वैल्यू कहां डाली जानी चाहिए: अगर अपने-आप भरने वाले कॉलम के ठीक बाईं या दाईं ओर कोई डेटा मौजूद है, तो नई वैल्यू सिर्फ़ इस आस-पास के डेटा तक ही बढ़ाई जाती हैं.
उदाहरण के लिए, अगर A1:A20 में बढ़ती हुई संख्याओं की सीरीज़ भरी गई है और इस तरीके को B1:B4 रेंज पर कॉल किया जाता है, जिसमें तारीखों की सीरीज़ शामिल है, तो नई वैल्यू सिर्फ़ B5:B20 में डाली जाती हैं. इस तरह, ये नई वैल्यू उन सेल से "जुड़" जाती हैं जिनमें कॉलम A में वैल्यू मौजूद होती हैं.
const sheet = SpreadsheetApp.getActiveSheet(); // A1:A20 has values [1, 2, 3, ... 20]. // B1:B4 has values [1/1/2017, 1/2/2017, ...] const sourceRange = sheet.getRange('B1:B4'); // Results in B5:B20 having values [1/5/2017, ... 1/20/2017] sourceRange.autoFillToNeighbor(SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
series | Auto | ऑटोमैटिक भरने की सुविधा वाली सीरीज़ का वह टाइप जिसका इस्तेमाल नई वैल्यू का हिसाब लगाने के लिए किया जाना चाहिए. इस सीरीज़ का असर, सोर्स डेटा के टाइप और उसकी मात्रा के आधार पर अलग-अलग होता है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
breakApart()
रेंज में मौजूद एक से ज़्यादा कॉलम वाली सेल को फिर से अलग-अलग सेल में बांटें.
किसी रेंज पर इस फ़ंक्शन को कॉल करने का मतलब है कि आपने कोई रेंज चुनी है और फ़ॉर्मैट करें > सेल मर्ज करें > अनमर्ज करें पर क्लिक किया है.
// Opens the spreadsheet by its URL. If you created your script from within a // Google Sheets spreadsheet, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:C6 on Sheet1. const range = sheet.getRange('A1:C6'); // Unmerges the range A1:C6 into individual cells. range.breakApart();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
canEdit()
इस कुकी से यह तय होता है कि उपयोगकर्ता के पास रेंज में मौजूद हर सेल में बदलाव करने की अनुमति है या नहीं. स्प्रेडशीट का मालिक, सुरक्षित की गई रेंज और शीट में हमेशा बदलाव कर सकता है.
// Opens the spreadsheet by its URL. If you created your script from within a // Google Sheets spreadsheet, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:C6 on Sheet1. const range = sheet.getRange('A1:C6'); // Logs whether the user has permission to edit every cell in the range. console.log(range.canEdit());
वापसी का टिकट
Boolean — true अगर उपयोगकर्ता के पास रेंज में मौजूद हर सेल में बदलाव करने की अनुमति है; false
अन्यथा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
check()
यह फ़ंक्शन, रेंज में मौजूद चेकबॉक्स की स्थिति को “चुना गया” में बदल देता है. यह रेंज में मौजूद उन सेल को अनदेखा करता है जिनमें फ़िलहाल, चुने गए या नहीं चुने गए कॉन्फ़िगर किए गए मान शामिल नहीं हैं.
// Changes the state of cells which currently contain either the checked or // unchecked value configured in the range A1:B10 to 'checked'. const range = SpreadsheetApp.getActive().getRange('A1:B10'); range.check();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clear()
इससे कॉन्टेंट और फ़ॉर्मैट की रेंज मिट जाती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D10'); range.clear();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clear(options)
इससे कॉन्टेंट, फ़ॉर्मैट, डेटा की पुष्टि करने के नियम, और/या टिप्पणियों की रेंज मिट जाती है. ऐसा, दिए गए बेहतर विकल्पों के हिसाब से होता है. डिफ़ॉल्ट रूप से, सारा डेटा मिटा दिया जाता है.
// The code below clears range C2:G7 in the active sheet, but preserves the // format, data validation rules, and comments. SpreadsheetApp.getActiveSheet().getRange(2, 3, 6, 5).clear({ contentsOnly: true });
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
options | Object | यह एक JavaScript ऑब्जेक्ट है, जो नीचे दिए गए बेहतर पैरामीटर तय करता है. |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
comments | Boolean | क्या सिर्फ़ टिप्पणियां मिटानी हैं. |
contents | Boolean | सिर्फ़ कॉन्टेंट हटाना है या नहीं. |
format | Boolean | सिर्फ़ फ़ॉर्मैट मिटाना है या नहीं. ध्यान दें कि फ़ॉर्मैट मिटाने पर, डेटा की पुष्टि करने के नियम भी मिट जाते हैं. |
validations | Boolean | डेटा की पुष्टि करने के नियमों को ही मिटाना है या नहीं. |
skip | Boolean | फ़िल्टर की गई लाइनों को हटाने से बचना है या नहीं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearContent()
इससे रेंज का कॉन्टेंट मिट जाता है. हालांकि, फ़ॉर्मैटिंग नहीं बदलती.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D10'); range.clearContent();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearDataValidations()
इस फ़ंक्शन का इस्तेमाल करके, रेंज के लिए डेटा की पुष्टि करने के नियमों को हटाया जा सकता है.
// Clear the data validation rules for cells A1:B5. const range = SpreadsheetApp.getActive().getRange('A1:B5'); range.clearDataValidations();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearFormat()
इससे इस रेंज के लिए फ़ॉर्मैटिंग हट जाती है.
इससे रेंज में मौजूद सेल या सेल के टेक्स्ट का फ़ॉर्मैट हट जाता है. हालांकि, इससे संख्या के फ़ॉर्मैट से जुड़े कोई भी नियम रीसेट नहीं होते.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D10'); range.clearFormat();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
clearNote()
यह फ़ंक्शन, दी गई सेल या सेल में मौजूद नोट को मिटा देता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D10'); range.clearNote();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
collapseGroups()
इससे रेंज में पूरी तरह से शामिल सभी ग्रुप छोटे हो जाते हैं. अगर कोई भी ग्रुप पूरी तरह से रेंज में नहीं है, तो रेंज में आंशिक रूप से मौजूद सबसे बड़े ग्रुप को छोटा कर दिया जाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getActiveRange(); // All row and column groups within the range are collapsed. range.collapseGroups();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copyFormatToRange(gridId, column, columnEnd, row, rowEnd)
रेंज की फ़ॉर्मैटिंग को दी गई जगह पर कॉपी करता है. अगर डेस्टिनेशन रेंज, सोर्स रेंज से बड़ी या छोटी है, तो सोर्स को उसके हिसाब से दोहराया या छोटा किया जाता है. ध्यान दें कि इस तरीके से सिर्फ़ फ़ॉर्मैटिंग कॉपी होती है.
gridId पैरामीटर के बारे में ज़्यादा जानकारी के लिए, getGridId() देखें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const source = ss.getSheets()[0]; const range = source.getRange('B2:D4'); // This copies the formatting in B2:D4 in the source sheet to // D4:F6 in the sheet with gridId 1555299895. Note that you can get the gridId // of a sheet by calling sheet.getSheetId() or range.getGridId(). range.copyFormatToRange(1555299895, 4, 6, 4, 6);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
grid | Integer | स्प्रेडशीट में मौजूद शीट का यूनीक आईडी. इससे कोई फ़र्क़ नहीं पड़ता कि शीट किस पोज़िशन पर है. |
column | Integer | टारगेट रेंज का पहला कॉलम. |
column | Integer | टारगेट रेंज का आखिरी कॉलम. |
row | Integer | टारगेट रेंज की शुरुआती लाइन. |
row | Integer | टारगेट रेंज की आखिरी लाइन. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
copyFormatToRange(sheet, column, columnEnd, row, rowEnd)
रेंज की फ़ॉर्मैटिंग को दी गई जगह पर कॉपी करता है. अगर डेस्टिनेशन रेंज, सोर्स रेंज से बड़ी या छोटी है, तो सोर्स को उसके हिसाब से दोहराया या छोटा किया जाता है. ध्यान दें कि इस तरीके से सिर्फ़ फ़ॉर्मैटिंग कॉपी होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const source = ss.getSheets()[0]; const destination = ss.getSheets()[1]; const range = source.getRange('B2:D4'); // This copies the formatting in B2:D4 in the source sheet to // D4:F6 in the second sheet range.copyFormatToRange(destination, 4, 6, 4, 6);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Sheet | टारगेट शीट. |
column | Integer | टारगेट रेंज का पहला कॉलम. |
column | Integer | टारगेट रेंज का आखिरी कॉलम. |
row | Integer | टारगेट रेंज की शुरुआती लाइन. |
row | Integer | टारगेट रेंज की आखिरी लाइन. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copyTo(destination)
यह फ़ंक्शन, सेल की किसी रेंज से डेटा को सेल की दूसरी रेंज में कॉपी करता है. वैल्यू और फ़ॉर्मैट, दोनों कॉपी किए जाते हैं.
// The code below copies the first 5 columns over to the 6th column. const sheet = SpreadsheetApp.getActiveSheet(); const rangeToCopy = sheet.getRange(1, 1, sheet.getMaxRows(), 5); rangeToCopy.copyTo(sheet.getRange(1, 6));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
destination | Range | कॉपी करने के लिए डेस्टिनेशन रेंज; सिर्फ़ सबसे ऊपर बाईं ओर के सेल की पोज़िशन काम की होती है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copyTo(destination, copyPasteType, transposed)
यह फ़ंक्शन, सेल की किसी रेंज से डेटा को सेल की दूसरी रेंज में कॉपी करता है.
// The code below copies only the values of the first 5 columns over to the 6th // column. const sheet = SpreadsheetApp.getActiveSheet(); sheet.getRange('A:E').copyTo( sheet.getRange('F1'), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false, );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
destination | Range | कॉपी करने के लिए डेस्टिनेशन रेंज; सिर्फ़ सबसे ऊपर बाईं ओर के सेल की पोज़िशन काम की होती है. |
copy | Copy | यह एक ऐसा टाइप है जिससे यह तय होता है कि रेंज का कॉन्टेंट, डेस्टिनेशन में कैसे चिपकाया जाएगा. |
transposed | Boolean | चुनें कि रेंज को ट्रांसपोज़ किए गए ओरिएंटेशन में चिपकाया जाना चाहिए या नहीं. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copyTo(destination, options)
यह फ़ंक्शन, सेल की किसी रेंज से डेटा को सेल की दूसरी रेंज में कॉपी करता है. डिफ़ॉल्ट रूप से, वैल्यू और फ़ॉर्मैटिंग, दोनों को कॉपी किया जाता है. हालांकि, अडवांस आर्ग्युमेंट का इस्तेमाल करके इसे बदला जा सकता है.
// The code below copies only the values of the first 5 columns over to the 6th // column. const sheet = SpreadsheetApp.getActiveSheet(); sheet.getRange('A:E').copyTo(sheet.getRange('F1'), {contentsOnly: true});
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
destination | Range | कॉपी करने के लिए डेस्टिनेशन रेंज; सिर्फ़ सबसे ऊपर बाईं ओर के सेल की पोज़िशन काम की होती है. |
options | Object | यह एक JavaScript ऑब्जेक्ट है, जो नीचे दिए गए बेहतर पैरामीटर तय करता है. |
उन्नत पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
format | Boolean | से पता चलता है कि सिर्फ़ फ़ॉर्मैट कॉपी किया जाना चाहिए |
contents | Boolean | इससे पता चलता है कि सिर्फ़ कॉन्टेंट को कॉपी किया जाना चाहिए |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
copyValuesToRange(gridId, column, columnEnd, row, rowEnd)
रेंज के कॉन्टेंट को दी गई जगह पर कॉपी करता है. अगर डेस्टिनेशन रेंज, सोर्स रेंज से बड़ी या छोटी है, तो सोर्स को उसके हिसाब से दोहराया या छोटा किया जाता है.
gridId पैरामीटर के बारे में ज़्यादा जानकारी के लिए, getGridId() देखें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const source = ss.getSheets()[0]; const range = source.getRange('B2:D4'); // This copies the data in B2:D4 in the source sheet to // D4:F6 in the sheet with gridId 0 range.copyValuesToRange(0, 4, 6, 4, 6);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
grid | Integer | स्प्रेडशीट में मौजूद शीट का यूनीक आईडी. इससे कोई फ़र्क़ नहीं पड़ता कि शीट किस पोज़िशन पर है. |
column | Integer | टारगेट रेंज का पहला कॉलम. |
column | Integer | टारगेट रेंज का आखिरी कॉलम. |
row | Integer | टारगेट रेंज की शुरुआती लाइन. |
row | Integer | टारगेट रेंज की आखिरी लाइन. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
copyValuesToRange(sheet, column, columnEnd, row, rowEnd)
रेंज के कॉन्टेंट को दी गई जगह पर कॉपी करता है. अगर डेस्टिनेशन रेंज, सोर्स रेंज से बड़ी या छोटी है, तो सोर्स को उसके हिसाब से दोहराया या छोटा किया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const source = ss.getSheets()[0]; const destination = ss.getSheets()[1]; const range = source.getRange('B2:D4'); // This copies the data in B2:D4 in the source sheet to // D4:F6 in the second sheet range.copyValuesToRange(destination, 4, 6, 4, 6);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sheet | Sheet | टारगेट शीट. |
column | Integer | टारगेट रेंज का पहला कॉलम. |
column | Integer | टारगेट रेंज का आखिरी कॉलम. |
row | Integer | टारगेट रेंज की शुरुआती लाइन. |
row | Integer | टारगेट रेंज की आखिरी लाइन. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
createDataSourcePivotTable(dataSource)
यह फ़ंक्शन, डेटा सोर्स से एक खाली डेटा सोर्स पिवट टेबल बनाता है. यह टेबल, इस रेंज की पहली सेल में ऐंकर की जाती है.
इस उदाहरण में, नई डेटा सोर्स पिवट टेबल बनाने और उसे कॉन्फ़िगर करने का तरीका दिखाया गया है.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); const anchorCell = spreadsheet.getSheets()[0].getRange('A1'); const dataSource = spreadsheet.getDataSources()[0]; const pivotTable = anchorCell.createDataSourcePivotTable(dataSource); pivotTable.addRowGroup('dataColumnA'); pivotTable.addColumnGroup('dataColumnB'); pivotTable.addPivotValue( 'dataColumnC', SpreadsheetApp.PivotTableSummarizeFunction.SUM, ); pivotTable.addFilter( 'dataColumnA', SpreadsheetApp.newFilterCriteria().whenTextStartsWith('A').build(), );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
data | Data | वह डेटा सोर्स जिससे पिवट टेबल बनानी है. |
वापसी का टिकट
DataSourcePivotTable — यह नया डेटा सोर्स पिवट टेबल है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
createDataSourceTable(dataSource)
यह फ़ंक्शन, डेटा सोर्स से एक खाली डेटा सोर्स टेबल बनाता है. यह टेबल, इस रेंज के पहले सेल पर ऐंकर की जाती है.
इस उदाहरण में, नई डेटा सोर्स टेबल बनाने और उसे कॉन्फ़िगर करने का तरीका दिखाया गया है.
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); const anchorCell = spreadsheet.getSheets()[0].getRange('A1'); const dataSource = spreadsheet.getDataSources()[0]; const dataSourceTable = anchorCell.createDataSourceTable(dataSource) .addColumns('dataColumnA', 'dataColumnB', 'dataColumnC') .addSortSpec('dataColumnA', true) // ascending=true .addSortSpec('dataColumnB', false); // ascending=false
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
data | Data | वह डेटा सोर्स जिससे पिवट टेबल बनानी है. |
वापसी का टिकट
DataSourceTable — यह नई बनाई गई डेटा सोर्स टेबल है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
createDeveloperMetadataFinder()
यह फ़ंक्शन, इस रेंज के दायरे में डेवलपर मेटाडेटा ढूंढने के लिए DeveloperMetadataFinderApi ऑब्जेक्ट दिखाता है. मेटाडेटा को रेंज के दायरे में सिर्फ़ तब माना जाता है, जब वह पूरी तरह से उस रेंज में शामिल हो. उदाहरण के लिए, लाइन ‘3:3’ से जुड़ा मेटाडेटा, रेंज ‘A1:D5’ के दायरे में नहीं है. हालांकि, यह रेंज ‘1:5’ के दायरे में है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:C6. const range = sheet.getRange('A1:C6'); // Creates a developer metadata finder to search for metadata in the scope of // this range. const developerMetaDataFinder = range.createDeveloperMetadataFinder(); // Logs information about the developer metadata finder to the console. const developerMetaData = developerMetaDataFinder.find()[0]; console.log(developerMetaData.getKey()); console.log(developerMetaData.getValue()); console.log(developerMetaData.getVisibility().toString());
वापसी का टिकट
DeveloperMetadataFinder — यह डेवलपर मेटाडेटा ढूंढने वाला टूल है. इसकी मदद से, इस रेंज के दायरे में मेटाडेटा खोजा जा सकता है.
createFilter()
यह फ़ंक्शन, फ़िल्टर बनाता है और उसे शीट पर मौजूद तय की गई रेंज पर लागू करता है. किसी शीट पर एक से ज़्यादा फ़िल्टर नहीं बनाए जा सकते. फ़िल्टर बनाने के बाद, उसे ऐक्सेस करने और उसमें बदलाव करने के लिए, getFilter() या Sheet.getFilter() का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSheet(); const range = ss.getRange('A1:C20'); // Creates a new filter and applies it to the range A1:C20 on the active sheet. function createFilter() { range.createFilter(); } // Gets the filter and applies criteria that only shows cells that aren't empty. function getFilterAddCriteria() { const filter = range.getFilter(); const criteria = SpreadsheetApp.newFilterCriteria().whenCellNotEmpty().build(); filter.setColumnFilterCriteria(2, criteria); }
Grid शीट के लिए फ़िल्टर बनाएं. यह शीट का डिफ़ॉल्ट टाइप होता है.
ग्रिड शीट ऐसी शीट होती हैं जो किसी डेटाबेस से कनेक्ट नहीं होती हैं. अन्य तरह के फ़िल्टर बनाने के लिए,
यहां दिया गया लेख पढ़ें:
PivotTable.addFilter(sourceDataColumn, filterCriteria)की मदद से पिवट टेबल फ़िल्टर बनानाDataSourceSheet.addFilter(columnName, filterCriteria)की मदद से, डेटाबेस से कनेक्ट की गई किसी शीट के लिए फ़िल्टर बनानाDataSourcePivotTable.addFilter(columnName, filterCriteria)की मदद से डेटाबेस से कनेक्ट की गई पिवट टेबल के लिए फ़िल्टर बनाना
वापसी का टिकट
Filter — नया फ़िल्टर.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
createPivotTable(sourceData)
इस फ़ंक्शन की मदद से, तय की गई रेंज की पहली सेल में ऐंकर की गई sourceData से एक खाली पिवट टेबल बनाई जाती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets cell A1 as a range in order to place the pivot table. const range = sheet.getRange('A1'); // Gets the range of the source data for the pivot table. const dataRange = sheet.getRange('E12:G20'); // Creates an empty pivot table from the specified source data. const pivotTable = range.createPivotTable(dataRange); // Logs the values from the pivot table's source data to the console. console.log(pivotTable.getSourceDataRange().getValues());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
source | Range | पिवट टेबल बनाने के लिए डेटा. |
वापसी का टिकट
PivotTable — नया बनाया गया PivotTable.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
createTextFinder(findText)
यह फ़ंक्शन, रेंज के लिए टेक्स्ट फ़ाइंडर बनाता है. इसकी मदद से, इस रेंज में टेक्स्ट ढूंढा और बदला जा सकता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getActiveRange(); // Creates a text finder for the range. const textFinder = range.createTextFinder('dog'); // Returns the first occurrence of 'dog'. const firstOccurrence = textFinder.findNext(); // Replaces the last found occurrence of 'dog' with 'cat' and returns the number // of occurrences replaced. const numOccurrencesReplaced = textFinder.replaceWith('cat');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
find | String | वह टेक्स्ट जिसे खोजना है. |
वापसी का टिकट
TextFinder — रेंज के लिए TextFinder
deleteCells(shiftDimension)
यह सेल की इस रेंज को मिटाता है. शीट में मौजूद डेटा को, मिटाई गई रेंज की ओर ले जाया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D10'); range.deleteCells(SpreadsheetApp.Dimension.COLUMNS);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
shift | Dimension | वह डाइमेंशन जिसके हिसाब से मौजूदा डेटा को शिफ़्ट करना है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
expandGroups()
यह फ़ंक्शन, उन ग्रुप को बड़ा करता है जिनकी रेंज या कंट्रोल टॉगल, इस रेंज से इंटरसेक्ट करता है. कंट्रोल टॉगल की जगह वह इंडेक्स होती है जिस पर कंट्रोल टॉगल दिखता है. यह सेटिंग के आधार पर, ग्रुप से ठीक पहले या बाद में दिखता है. अगर एक ही जगह पर एक से ज़्यादा ग्रुप हैं, तो सबसे छोटे ग्रुप को बड़ा किया जाता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getActiveRange(); // All row and column groups within the range are expanded. range.expandGroups();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getA1Notation()
यह फ़ंक्शन, A1 नोटेशन में रेंज की स्ट्रिंग के बारे में जानकारी देता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange(1, 1, 2, 5); // Logs "A1:E2" Logger.log(range.getA1Notation());
वापसी का टिकट
String — A1 नोटेशन में रेंज की जानकारी देने वाली स्ट्रिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getBackground()
यह फ़ंक्शन, रेंज (उदाहरण के लिए, '#ffffff') में सबसे ऊपर मौजूद बाएं सेल के बैकग्राउंड का रंग दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B5'); Logger.log(cell.getBackground());
वापसी का टिकट
String — बैकग्राउंड का कलर कोड.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getBackgroundObject()
यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के बैकग्राउंड का रंग दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B5'); Logger.log(cell.getBackgroundObject().asRgbColor().asHexString());
वापसी का टिकट
Color — रेंज में सबसे ऊपर मौजूद बाईं ओर की सेल के बैकग्राउंड का रंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getBackgroundObjects()
यह फ़ंक्शन, रेंज में मौजूद सेल के बैकग्राउंड के रंग दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B5:C6'); const bgColors = range.getBackgroundObjects(); for (const i in bgColors) { for (const j in bgColors[i]) { Logger.log(bgColors[i][j].asRgbColor().asHexString()); } }
वापसी का टिकट
Color[][] — बैकग्राउंड के रंगों का दो डाइमेंशन वाला ऐरे.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getBackgrounds()
यह फ़ंक्शन, रेंज में मौजूद सेल के बैकग्राउंड के रंग दिखाता है. उदाहरण के लिए, '#ffffff'.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B5:C6'); const bgColors = range.getBackgrounds(); for (const i in bgColors) { for (const j in bgColors[i]) { Logger.log(bgColors[i][j]); } }
वापसी का टिकट
String[][] — यह बैकग्राउंड के रंग कोड का दो डाइमेंशन वाला ऐरे होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getBandings()
इस फ़ंक्शन से, इस रेंज की किसी भी सेल पर लागू की गई सभी बैंडिंग मिलती हैं.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Sets a range. const range = sheet.getRange('A1:K50'); // Gets the banding info for the range. const bandings = range.getBandings(); // Logs the second row color for each banding to the console. for (const banding of bandings) { console.log(banding.getSecondRowColor()); }
वापसी का टिकट
Banding[] — इस रेंज की किसी भी सेल पर लागू की गई सभी बैंडिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getCell(row, column)
यह फ़ंक्शन, किसी रेंज में मौजूद सेल की जानकारी देता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); // The row and column here are relative to the range // getCell(1,1) in this code returns the cell at B2 const cell = range.getCell(1, 1); Logger.log(cell.getValue());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह रेंज के हिसाब से सेल की लाइन होती है. |
column | Integer | यह रेंज के हिसाब से सेल का कॉलम होता है. |
वापसी का टिकट
Range — यह एक ऐसी रेंज होती है जिसमें दिए गए निर्देशांकों पर मौजूद एक सेल शामिल होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getColumn()
यह फ़ंक्शन, इस रेंज के लिए शुरुआती कॉलम की पोज़िशन दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); // Logs "2.0" Logger.log(range.getColumn());
वापसी का टिकट
Integer — स्प्रेडशीट में रेंज के शुरुआती कॉलम की पोज़िशन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataRegion()
यह फ़ंक्शन, रेंज की एक कॉपी दिखाता है. इस कॉपी में, रेंज को चारों दिशाओं Direction में बढ़ाया जाता है, ताकि डेटा वाले सभी आस-पास के सेल शामिल किए जा सकें. अगर रेंज के चारों ओर खाली सेल हैं और उनमें डायगोनल के साथ मौजूद सेल शामिल नहीं हैं, तो रेंज ही दिखाई जाती है. यह एडिटर में रेंज चुनने और Ctrl+A टाइप करने जैसा है.
// Assume the active spreadsheet is blank. const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.getRange('C2').setValue(100); sheet.getRange('B3').setValue(100); sheet.getRange('D3').setValue(100); sheet.getRange('C4').setValue(100); // Logs "B2:D4" Logger.log(sheet.getRange('C3').getDataRegion().getA1Notation());
वापसी का टिकट
Range — यह रेंज का डेटा क्षेत्र या पूरी स्प्रेडशीट के लिए रेंज होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataRegion(dimension)
अगर तय किया गया डाइमेंशन Dimension.ROWS है, तो यह फ़ंक्शन, Direction.UP और Direction.DOWN को बड़ा करके रेंज की कॉपी दिखाता है. अगर डाइमेंशन Dimension.COLUMNS है, तो यह फ़ंक्शन, Direction.NEXT और Direction.PREVIOUS को बड़ा करके रेंज की कॉपी दिखाता है. रेंज को बड़ा करने की सुविधा, टेबल के तौर पर व्यवस्थित की गई रेंज के बगल में मौजूद डेटा का पता लगाने पर काम करती है. बढ़ाई गई रेंज में, तय किए गए डाइमेंशन के हिसाब से, डेटा वाली सभी आस-पास की सेल शामिल होती हैं. इसमें टेबल की सीमाएं भी शामिल होती हैं. अगर बताई गई डाइमेंशन के हिसाब से ओरिजनल रेंज के चारों ओर खाली सेल हैं, तो रेंज को ही दिखाया जाता है. यह तरीका, एडिटर में कॉलम के लिए
Ctrl+Space या लाइनों के लिए Shift+Space टाइप करके रेंज चुनने जैसा ही है.
// Assume the active spreadsheet is blank. const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; sheet.getRange('C2').setValue(100); sheet.getRange('B3').setValue(100); sheet.getRange('D3').setValue(100); sheet.getRange('C4').setValue(100); // Logs "C2:C4" Logger.log( sheet.getRange('C3') .getDataRegion(SpreadsheetApp.Dimension.ROWS) .getA1Notation(), ); // Logs "B3:D3" Logger.log( sheet.getRange('C3') .getDataRegion(SpreadsheetApp.Dimension.COLUMNS) .getA1Notation(), );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
dimension | Dimension | वह डाइमेंशन जिसके हिसाब से रेंज को बड़ा करना है. |
वापसी का टिकट
Range — यह रेंज का डेटा क्षेत्र या ऐसी रेंज होती है जिसमें ओरिजनल रेंज के हर कॉलम या हर लाइन को शामिल किया जाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceFormula()
यह फ़ंक्शन, रेंज में मौजूद पहली सेल के लिए DataSourceFormula वैल्यू दिखाता है. अगर सेल में डेटा सोर्स का फ़ॉर्मूला नहीं है, तो यह null वैल्यू दिखाता है.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1 on Sheet1. const range = sheet.getRange('A1'); // Gets the data source formula from cell A1. const dataSourceFormula = range.getDataSourceFormula(); // Gets the formula. const formula = dataSourceFormula.getFormula(); // Logs the formula. console.log(formula);
वापसी का टिकट
DataSourceFormula|null — सेल के लिए DataSourceFormula.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceFormulas()
यह फ़ंक्शन, रेंज में मौजूद सेल के लिए DataSourceFormula दिखाता है.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:B5 on Sheet1. const range = sheet.getRange('A1:B5'); // Gets an array of the data source formulas in the range A1:B5. const dataSourceFormulas = range.getDataSourceFormulas(); // Logs the first formula in the array. console.log(dataSourceFormulas[0].getFormula());
वापसी का टिकट
DataSourceFormula[] — DataSourceFormula का ऐरे.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourcePivotTables()
इस फ़ंक्शन से, रेंज से इंटरसेक्ट करने वाली सभी डेटा सोर्स पिवट टेबल मिलती हैं.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:G50 on Sheet1. const range = sheet.getRange('A1:G50'); // Gets an array of the data source pivot tables in the range A1:G50. const dataSourcePivotTables = range.getDataSourcePivotTables(); // Logs the last time that the first pivot table in the array was refreshed. console.log(dataSourcePivotTables[0].getStatus().getLastRefreshedTime());
वापसी का टिकट
DataSourcePivotTable[] — डेटा सोर्स की पिवट टेबल की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceTables()
इस फ़ंक्शन से, रेंज के साथ इंटरसेक्ट करने वाली सभी डेटा सोर्स टेबल मिलती हैं.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:G50 on Sheet1. const range = sheet.getRange('A1:G50'); // Gets the first data source table in the range A1:G50. const dataSourceTable = range.getDataSourceTables()[0]; // Logs the time of the last completed data execution on the data source table. console.log(dataSourceTable.getStatus().getLastExecutionTime());
वापसी का टिकट
DataSourceTable[] — डेटा सोर्स टेबल की सूची.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataSourceUrl()
इस रेंज में मौजूद डेटा के लिए यूआरएल दिखाता है. इसका इस्तेमाल चार्ट और क्वेरी बनाने के लिए किया जा सकता है.
Code.gs
function doGet() { const ss = SpreadsheetApp.openById( '1khO6hBWTNNyvyyxvob7aoZTI9ZvlqqASNeq0e29Tw2c', ); const sheet = ss.getSheetByName('ContinentData'); const range = sheet.getRange('A1:B8'); const template = HtmlService.createTemplateFromFile('piechart'); template.dataSourceUrl = range.getDataSourceUrl(); return template.evaluate(); }
piechart.html
<!DOCTYPE html>
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages': ['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(queryData);
function queryData() {
var query = new google.visualization.Query('<?= dataSourceUrl ?>');
query.send(drawChart);
}
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart(response) {
if (response.isError()) {
alert('Error: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
var data = response.getDataTable();
// Set chart options.
var options = {
title: 'Population by Continent',
width: 400,
height: 300
};
// Instantiate and draw the chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<!-- Div that holds the pie chart. -->
<div id="chart_div"></div>
</body>
</html>वापसी का टिकट
String — इस रेंज के लिए डेटा सोर्स के तौर पर यूआरएल. इसे चार्ट जैसे अन्य एपीआई को पास किया जा सकता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataTable()
इस ऑब्जेक्ट में मौजूद डेटा को DataTable के तौर पर दिखाएं.
// Opens the spreadsheet file by its ID. If you created your script from a // Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet(). // TODO(developer): Replace the ID with your own. const ss = SpreadsheetApp.openById('abc123456'); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:B7 on Sheet1. const range = sheet.getRange('A1:B7'); // Gets the range A1:B7 as a data table. The values in each column must be of // the same type. const datatable = range.getDataTable(); // Uses the Charts service to build a bar chart from the data table. // This doesn't build an embedded chart. To do that, use // sheet.newChart().addRange() instead. const chart = Charts.newBarChart() .setDataTable(datatable) .setOption('title', 'Your Chart Title Here') .build();
वापसी का टिकट
DataTable — डेटा को डेटाटेबल के तौर पर दिखाता है.
getDataTable(firstRowIsHeader)
इस रेंज में मौजूद डेटा को DataTable के तौर पर दिखाएं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:B7'); // Calling this method with "true" sets the first line to be the title of the // axes const datatable = range.getDataTable(true); // Note that this doesn't build an EmbeddedChart, so you can't just use // Sheet#insertChart(). To do that, use sheet.newChart().addRange() instead. const chart = Charts.newBarChart() .setDataTable(datatable) .setOption('title', 'Your Title Here') .build();
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
first | Boolean | पहली लाइन को हेडर के तौर पर इस्तेमाल करना है या नहीं. |
वापसी का टिकट
DataTable — डेटा को डेटाटेबल के तौर पर दिखाया जाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataValidation()
यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए, डेटा की पुष्टि करने का नियम दिखाता है. अगर सेल में डेटा की पुष्टि करने की सुविधा सेट नहीं की गई है, तो यह तरीका null दिखाता है.
// Log information about the data validation rule for cell A1. const cell = SpreadsheetApp.getActive().getRange('A1'); const rule = cell.getDataValidation(); if (rule != null) { const criteria = rule.getCriteriaType(); const args = rule.getCriteriaValues(); Logger.log('The data validation rule is %s %s', criteria, args); } else { Logger.log('The cell does not have a data validation rule.'); }
वापसी का टिकट
DataValidation — यह रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए, डेटा की पुष्टि करने का नियम है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDataValidations()
यह फ़ंक्शन, रेंज में मौजूद सभी सेल के लिए डेटा की पुष्टि करने के नियम दिखाता है. अगर किसी सेल पर डेटा की पुष्टि करने की सुविधा सेट नहीं की गई है, तो यह तरीका उस सेल के लिए, ऐरे में उसकी पोज़िशन के हिसाब से null दिखाता है.
// Change existing data validation rules that require a date in 2013 to require // a date in 2014. const oldDates = [new Date('1/1/2013'), new Date('12/31/2013')]; const newDates = [new Date('1/1/2014'), new Date('12/31/2014')]; const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()); const rules = range.getDataValidations(); for (let i = 0; i < rules.length; i++) { for (let j = 0; j < rules[i].length; j++) { const rule = rules[i][j]; if (rule != null) { const criteria = rule.getCriteriaType(); const args = rule.getCriteriaValues(); if (criteria === SpreadsheetApp.DataValidationCriteria.DATE_BETWEEN && args[0].getTime() === oldDates[0].getTime() && args[1].getTime() === oldDates[1].getTime()) { // Create a builder from the existing rule, then change the dates. rules[i][j] = rule.copy().withCriteria(criteria, newDates).build(); } } } } range.setDataValidations(rules);
वापसी का टिकट
DataValidation[][] — यह डेटा की पुष्टि करने वाले नियमों की दो डाइमेंशन वाली एक ऐसी सरणी होती है जो रेंज में मौजूद सेल से जुड़ी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDeveloperMetadata()
इस रेंज से जुड़ा डेवलपर मेटाडेटा मिलता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets row 2 on Sheet1. const range = sheet.getRange('2:2'); // Adds metadata to row 2. range.addDeveloperMetadata('NAME', 'GOOGLE'); // Logs the metadata to console. for (const metadata of range.getDeveloperMetadata()) { console.log(`${metadata.getKey()}: ${metadata.getValue()}`); }
वापसी का टिकट
DeveloperMetadata[] — इस रेंज से जुड़ा डेवलपर मेटाडेटा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDisplayValue()
इस फ़ंक्शन से, रेंज में सबसे ऊपर मौजूद बाएं सेल की दिखाई गई वैल्यू मिलती है. वैल्यू String है.
दिखाई गई वैल्यू में तारीख, समय, और मुद्रा के फ़ॉर्मैटिंग फ़ॉर्मैटिंग को ध्यान में रखा जाता है. इसमें स्प्रेडशीट की स्थान-भाषा की सेटिंग के हिसाब से अपने-आप लागू होने वाले फ़ॉर्मैट भी शामिल हैं. खाली सेल, खाली स्ट्रिंग दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets cell A30 and sets its value to 'Test code.' const cell = sheet.getRange('A30'); cell.setValue('Test code'); // Gets the value and logs it to the console. console.log(cell.getDisplayValue());
वापसी का टिकट
String — इस सेल में दिखाई गई वैल्यू.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getDisplayValues()
यह फ़ंक्शन, इस रेंज के लिए वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है.
यह फ़ंक्शन, दिखाई गई वैल्यू का दो डाइमेंशन वाला ऐरे दिखाता है. इसे पहले पंक्ति और फिर कॉलम के हिसाब से इंडेक्स किया जाता है. ये वैल्यू, String ऑब्जेक्ट हैं. दिखाई गई वैल्यू में तारीख, समय, और मुद्रा के फ़ॉर्मैट को ध्यान में रखा जाता है. इसमें स्प्रेडशीट की स्थान-भाषा की सेटिंग के हिसाब से अपने-आप लागू होने वाले फ़ॉर्मैट भी शामिल हैं. कैटगरी में खाली सेल को एक खाली स्ट्रिंग के तौर पर दिखाया जाता है. ध्यान दें कि रेंज इंडेक्स 1, 1 से शुरू होता है, जबकि JavaScript कलेक्शन को [0][0] से इंडेक्स किया जाता है.
// The code below gets the displayed values for the range C2:G8 // in the active spreadsheet. Note that this is a JavaScript array. const values = SpreadsheetApp.getActiveSheet().getRange(2, 3, 6, 4).getDisplayValues(); Logger.log(values[0][0]);
वापसी का टिकट
String[][] — वैल्यू की दो डाइमेंशन वाली सरणी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFilter()
यह फ़ंक्शन, उस शीट पर मौजूद फ़िल्टर दिखाता है जिससे यह रेंज जुड़ी है. अगर शीट पर कोई फ़िल्टर नहीं है, तो यह null दिखाता है.
const ss = SpreadsheetApp.getActiveSheet(); const range = ss.getRange('A1:C20'); // Gets the existing filter on the sheet that the given range belongs to. const filter = range.getFilter();
वापसी का टिकट
Filter|null — फ़िल्टर.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontColorObject()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने में मौजूद सेल के फ़ॉन्ट का रंग दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getFontColorObject().asRgbColor().asHexString());
वापसी का टिकट
Color — रेंज में सबसे ऊपर मौजूद बाएं सेल के फ़ॉन्ट का रंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontColorObjects()
यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट के रंग दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getFontColorObjects(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j].asRgbColor().asHexString()); } }
वापसी का टिकट
Color[][] — यह रेंज में मौजूद सेल से जुड़े फ़ॉन्ट के रंगों की दो डाइमेंशन वाली सरणी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontFamilies()
यह फ़ंक्शन, रेंज में मौजूद सेल की फ़ॉन्ट फ़ैमिली दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getFontFamilies(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़ी फ़ॉन्ट फ़ैमिली का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontFamily()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल की फ़ॉन्ट फ़ैमिली दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getFontFamily());
वापसी का टिकट
String — सेल की फ़ॉन्ट फ़ैमिली.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontLine()
इस फ़ंक्शन से, रेंज के सबसे ऊपर बाईं ओर मौजूद सेल ('underline', 'line-through' या 'none') की लाइन स्टाइल मिलती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getFontLine());
वापसी का टिकट
String — फ़ॉन्ट लाइन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontLines()
इस फ़ंक्शन से, रेंज में मौजूद सेल की लाइन स्टाइल ('underline', 'line-through' या 'none') मिलती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getFontLines(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़ी फ़ॉन्ट लाइनों की दो डाइमेंशन वाली एक सरणी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontSize()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल के फ़ॉन्ट का साइज़ पॉइंट में दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getFontSize());
वापसी का टिकट
Integer — पॉइंट साइज़ में फ़ॉन्ट का साइज़.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontSizes()
यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट साइज़ दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getFontSizes(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
Integer[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट के फ़ॉन्ट साइज़ का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontStyle()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल के फ़ॉन्ट का स्टाइल ('italic' या 'normal') दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getFontStyle());
वापसी का टिकट
String — सेल में मौजूद टेक्स्ट का फ़ॉन्ट स्टाइल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontStyles()
यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट स्टाइल दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getFontStyles(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट की फ़ॉन्ट स्टाइल का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontWeight()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाले सेल के फ़ॉन्ट का वेट (सामान्य/बोल्ड) दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getFontWeight());
वापसी का टिकट
String — सेल में मौजूद टेक्स्ट के फ़ॉन्ट की मोटाई.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFontWeights()
यह फ़ंक्शन, रेंज में मौजूद सेल के फ़ॉन्ट वेट दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getFontWeights(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट के फ़ॉन्ट वेट की दो डाइमेंशन वाली सरणी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormula()
यह फ़ंक्शन, रेंज की सबसे ऊपर बाईं ओर मौजूद सेल के लिए फ़ॉर्मूला (A1 नोटेशन) दिखाता है. अगर सेल खाली है या उसमें कोई फ़ॉर्मूला नहीं है, तो यह फ़ंक्शन एक खाली स्ट्रिंग दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This assumes you have a function in B5 that sums up // B2:B4 const range = sheet.getRange('B5'); // Logs the calculated value and the formula Logger.log( 'Calculated value: %s Formula: %s', range.getValue(), range.getFormula(), );
वापसी का टिकट
String — सेल के लिए फ़ॉर्मूला.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormulaR1C1()
किसी सेल के लिए फ़ॉर्मूला (R1C1 नोटेशन) दिखाता है. अगर कोई फ़ॉर्मूला नहीं है, तो null दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B5'); const formula = range.getFormulaR1C1(); Logger.log(formula);
वापसी का टिकट
String — R1C1 नोटेशन में फ़ॉर्मूला.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormulas()
यह फ़ंक्शन, रेंज में मौजूद सेल के लिए फ़ॉर्मूले (A1 नोटेशन) दिखाता है. 2D अरे में मौजूद एंट्री, उन सेल के लिए खाली स्ट्रिंग होती हैं जिनमें कोई फ़ॉर्मूला नहीं होता.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B5:C6'); const formulas = range.getFormulas(); for (const i in formulas) { for (const j in formulas[i]) { Logger.log(formulas[i][j]); } }
वापसी का टिकट
String[][] — स्ट्रिंग फ़ॉर्मैट में फ़ॉर्मूलों की दो डाइमेंशन वाली कैटगरी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormulasR1C1()
यह फ़ंक्शन, रेंज में मौजूद सेल के लिए फ़ॉर्मूले (R1C1 नोटेशन) दिखाता है. 2D ऐरे में मौजूद एंट्री, फ़ॉर्मूला इस्तेमाल न करने वाली सेल के लिए null होती हैं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B5:C6'); const formulas = range.getFormulasR1C1(); for (const i in formulas) { for (const j in formulas[i]) { Logger.log(formulas[i][j]); } }
वापसी का टिकट
String[][] — R1C1 नोटेशन में फ़ॉर्मूलों की दो डाइमेंशन वाली ऐरे.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getGridId()
यह फ़ंक्शन, रेंज की पैरंट शीट का ग्रिड आईडी दिखाता है. आईडी, रैंडम धनात्मक पूर्णांक वैल्यू होते हैं.
// Log the grid ID of the first sheet (by tab position) in the spreadsheet. const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getGridId());
वापसी का टिकट
Integer — पैरंट शीट का ग्रिड आईडी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getHeight()
यह फ़ंक्शन, रेंज की ऊंचाई दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); // logs 3.0 Logger.log(range.getHeight());
वापसी का टिकट
Integer — रेंज की ऊंचाई.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getHorizontalAlignment()
यह फ़ंक्शन, रेंज के सबसे ऊपर बाएं कोने में मौजूद सेल के टेक्स्ट का हॉरिज़ॉन्टल अलाइनमेंट (बाएं/बीच/दाएं) दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getHorizontalAlignment());
वापसी का टिकट
String — सेल में मौजूद टेक्स्ट का हॉरिज़ॉन्टल अलाइनमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getHorizontalAlignments()
यह फ़ंक्शन, रेंज में मौजूद सेल के हॉरिज़ॉन्टल अलाइनमेंट दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getHorizontalAlignments(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट के हॉरिज़ॉन्टल अलाइनमेंट की दो डाइमेंशन वाली सरणी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getLastColumn()
यह फ़ंक्शन, आखिरी कॉलम की पोज़िशन दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); // Logs "4.0" Logger.log(range.getLastColumn());
वापसी का टिकट
Integer — स्प्रेडशीट में रेंज के आखिरी कॉलम की पोज़िशन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getLastRow()
आखिरी लाइन की पोज़िशन दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); // Logs "4.0" Logger.log(range.getLastRow());
वापसी का टिकट
Integer — स्प्रेडशीट में रेंज की आखिरी पंक्ति की पोज़िशन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getMergedRanges()
यह फ़ंक्शन, Range ऑब्जेक्ट की एक ऐसी कलेक्शन दिखाता है जिसमें मर्ज की गई सेल शामिल होती हैं. ये सेल या तो पूरी तरह से मौजूदा रेंज में होती हैं या इनमें से कम से कम एक सेल मौजूदा रेंज में होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:B3'); const mergedRanges = range.getMergedRanges(); for (let i = 0; i < mergedRanges.length; i++) { Logger.log(mergedRanges[i].getA1Notation()); Logger.log(mergedRanges[i].getDisplayValue()); }
वापसी का टिकट
Range[] — Range ऑब्जेक्ट का एक कलेक्शन. इससे रेंज में मौजूद मर्ज किए गए सेल के बारे में पता चलता है.
getNextDataCell(direction)
यह फ़ंक्शन, रेंज के पहले कॉलम और पहली लाइन में मौजूद सेल से शुरू होकर, दी गई दिशा में मौजूद अगली सेल दिखाता है. यह सेल, डेटा वाली सेल की लगातार रेंज का किनारा होती है या उस दिशा में स्प्रेडशीट के किनारे पर मौजूद सेल होती है. यह एडिटर में
Ctrl+[arrow key] टाइप करने के बराबर है.
// Assume the active spreadsheet is blank. const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('C3:E5'); // Logs "C1" Logger.log(range.getNextDataCell(SpreadsheetApp.Direction.UP).getA1Notation());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
direction | Direction | अगली डेटा क्षेत्र की आखिरी सेल को खोजने की दिशा. |
वापसी का टिकट
Range — यह डेटा क्षेत्र की आखिरी सेल या स्प्रेडशीट की आखिरी सेल होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNote()
यह फ़ंक्शन, दी गई रेंज से जुड़ा नोट दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getNote());
वापसी का टिकट
String — दी गई सेल से जुड़ा नोट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNotes()
यह फ़ंक्शन, रेंज में मौजूद सेल से जुड़े नोट दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getNotes(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़े नोट की दो डाइमेंशन वाली एक सरणी होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNumColumns()
यह फ़ंक्शन, इस रेंज में मौजूद कॉलम की संख्या दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D5'); Logger.log(range.getNumColumns());
वापसी का टिकट
Integer — इस रेंज में कॉलम की संख्या.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNumRows()
यह फ़ंक्शन, इस रेंज में मौजूद पंक्तियों की संख्या दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D5'); Logger.log(range.getNumRows());
वापसी का टिकट
Integer — इस रेंज में मौजूद पंक्तियों की संख्या.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNumberFormat()
इस फ़ंक्शन की मदद से, दी गई रेंज की सबसे ऊपर बाईं ओर मौजूद सेल की संख्या या तारीख की फ़ॉर्मैटिंग मिलती है. जवाब में मिले फ़ॉर्मैट पैटर्न के बारे में Sheets API के दस्तावेज़ में बताया गया है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('C4'); Logger.log(cell.getNumberFormat());
वापसी का टिकट
String — रेंज के सबसे ऊपर मौजूद बाएं सेल का नंबर फ़ॉर्मैट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getNumberFormats()
यह फ़ंक्शन, रेंज में मौजूद सेल के लिए संख्या या तारीख के फ़ॉर्मैट दिखाता है. जवाब में मिले फ़ॉर्मैट पैटर्न के बारे में, Sheets API के दस्तावेज़ में बताया गया है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B5:C6'); const formats = range.getNumberFormats(); for (const i in formats) { for (const j in formats[i]) { Logger.log(formats[i][j]); } }
वापसी का टिकट
String[][] — यह संख्या के फ़ॉर्मैट का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRichTextValue()
यह फ़ंक्शन, रेंज की सबसे ऊपर बाईं ओर मौजूद सेल के लिए रिच टेक्स्ट वैल्यू दिखाता है. अगर सेल की वैल्यू टेक्स्ट नहीं है, तो यह null दिखाता है.
// Gets the Rich Text value of cell D4. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('D4:F6'); const richText = range.getRichTextValue(); console.log(richText.getText());
वापसी का टिकट
RichTextValue|null — रेंज में सबसे ऊपर बाईं ओर मौजूद सेल की रिच टेक्स्ट वैल्यू या null, अगर सेल की वैल्यू टेक्स्ट नहीं है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRichTextValues()
यह फ़ंक्शन, रेंज में मौजूद सेल के लिए रिच टेक्स्ट वैल्यू दिखाता है.
// Gets the Rich Text values for all cells in range B5:C6 const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B5:C6'); const values = range.getRichTextValues(); for (let i = 0; i < values.length; i++) { for (let j = 0; j < values[i].length; j++) { console.log(values[i][j].getText()); } }
वापसी का टिकट
RichTextValue[][] — रिच टेक्स्ट वैल्यू का दो डाइमेंशन वाला कलेक्शन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRow()
इस फ़ंक्शन से, इस रेंज के लिए लाइन की पोज़िशन मिलती है. यह getRowIndex() के जैसा ही होता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2'); Logger.log(range.getRow());
वापसी का टिकट
Integer — रेंज की लाइन की पोज़िशन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getRowIndex()
इस फ़ंक्शन से, इस रेंज के लिए लाइन की पोज़िशन मिलती है. यह getRow() के जैसा ही होता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2'); Logger.log(range.getRowIndex());
वापसी का टिकट
Integer — रेंज की लाइन की पोज़िशन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
getSheet()
यह फ़ंक्शन, उस शीट को दिखाता है जिससे यह रेंज जुड़ी है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Gets the sheet that the range belongs to. const rangeSheet = range.getSheet(); // Gets the sheet name and logs it to the console. console.log(rangeSheet.getName());
वापसी का टिकट
Sheet — यह रेंज जिस शीट से जुड़ी है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTextDirection()
यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए टेक्स्ट की दिशा दिखाता है. अगर सेल के टेक्स्ट की दिशा का पता अपने-आप लगाने की सुविधा से चलता है, तो यह फ़ंक्शन null दिखाता है.
// Get the text direction of cell B1. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B1:D4'); Logger.log(range.getTextDirection());
वापसी का टिकट
TextDirection — रेंज में सबसे ऊपर मौजूद बाएं सेल के टेक्स्ट की दिशा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTextDirections()
इस फ़ंक्शन की मदद से, रेंज में मौजूद सेल के लिए टेक्स्ट की दिशाएं मिलती हैं. 2D ऐरे में मौजूद एंट्री, अपने-आप पहचान करने की सुविधा का इस्तेमाल करने वाली सेल के लिए null होती हैं.
// Get the text directions for all cells in range B5:C6 const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B5:C6'); const directions = range.getTextDirections(); for (let i = 0; i < directions.length; i++) { for (let j = 0; j < directions[i].length; j++) { Logger.log(directions[i][j]); } }
वापसी का टिकट
TextDirection[][] — यह टेक्स्ट की दिशाओं का दो डाइमेंशन वाला ऐरे होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTextRotation()
यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए टेक्स्ट रोटेशन की सेटिंग दिखाता है.
// Log the text rotation settings for a cell. const sheet = SpreadsheetApp.getActiveSheet(); const cell = sheet.getRange('A1'); Logger.log(cell.getTextRotation());
वापसी का टिकट
TextRotation — टेक्स्ट रोटेशन की सेटिंग.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTextRotations()
इस फ़ंक्शन की मदद से, रेंज में मौजूद सेल के लिए टेक्स्ट रोटेशन की सेटिंग मिलती हैं.
const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B2:D4'); const results = range.getTextRotations(); for (const i in results) { for (const j in results[i]) { const rotation = results[i][j]; Logger.log('Cell [%s, %s] has text rotation: %v', i, j, rotation); } }
वापसी का टिकट
TextRotation[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट रोटेशन का दो डाइमेंशन वाला अरे होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTextStyle()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं सेल के टेक्स्ट स्टाइल को दिखाता है.
// Get the text style of cell D4. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('D4:F6'); const style = range.getTextStyle(); Logger.log(style);
वापसी का टिकट
TextStyle — रेंज में सबसे ऊपर मौजूद बाएं सेल की टेक्स्ट स्टाइल.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getTextStyles()
यह फ़ंक्शन, रेंज में मौजूद सेल के लिए टेक्स्ट स्टाइल दिखाता है.
// Get the text styles for all cells in range B5:C6 const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B5:C6'); const styles = range.getTextStyles(); for (let i = 0; i < styles.length; i++) { for (let j = 0; j < styles[i].length; j++) { Logger.log(styles[i][j]); } }
वापसी का टिकट
TextStyle[][] — टेक्स्ट स्टाइल का दो डाइमेंशन वाला कलेक्शन.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getValue()
यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल की वैल्यू दिखाता है. सेल की वैल्यू के आधार पर, वैल्यू Number, Boolean, Date या String टाइप की हो सकती है. खाली सेल, एक खाली स्ट्रिंग दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Gets the value of the top-left cell in the range and logs it to the console. console.log(range.getValue());
वापसी का टिकट
Object — इस सेल में मौजूद वैल्यू.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getValues()
यह फ़ंक्शन, इस रेंज के लिए वैल्यू का रेक्टेंगुलर ग्रिड दिखाता है.
यह फ़ंक्शन, वैल्यू का दो डाइमेंशन वाला ऐरे दिखाता है. इसमें इंडेक्सिंग, पहले पंक्ति के हिसाब से और फिर कॉलम के हिसाब से की जाती है. सेल की वैल्यू के आधार पर, वैल्यू Number, Boolean, Date या String टाइप की हो सकती हैं. कैटगरी में खाली सेल को एक खाली स्ट्रिंग के तौर पर दिखाया जाता है. ध्यान दें कि रेंज इंडेक्स 1, 1 से शुरू होता है, जबकि JavaScript कैटगरी को [0][0] से इंडेक्स किया जाता है.
// The code below gets the values for the range C2:G8 // in the active spreadsheet. Note that this is a JavaScript array. const values = SpreadsheetApp.getActiveSheet().getRange(2, 3, 6, 4).getValues(); Logger.log(values[0][0]);
Date वैल्यू एक मान्य पैरामीटर नहीं है. अगर रेंज में Date वैल्यू वाला कोई सेल मौजूद है, तो getValues() वेब ऐप्लिकेशन को डेटा नहीं दिखा पाता. इसके बजाय, शीट से मिली सभी वैल्यू को JavaScript के साथ काम करने वाले प्रिमिटिव में बदलें. जैसे, Number, Boolean या String.वापसी का टिकट
Object[][] — वैल्यू की दो डाइमेंशन वाली सरणी.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getVerticalAlignment()
यह फ़ंक्शन, रेंज के सबसे ऊपर मौजूद बाएं कोने वाली सेल का वर्टिकल अलाइनमेंट (सबसे ऊपर/बीच में/सबसे नीचे) दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getVerticalAlignment());
वापसी का टिकट
String — सेल में मौजूद टेक्स्ट का वर्टिकल अलाइनमेंट.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getVerticalAlignments()
यह फ़ंक्शन, रेंज में मौजूद सेल के वर्टिकल अलाइनमेंट दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getVerticalAlignments(); for (const i in results) { for (const j in results[i]) { Logger.log(results[i][j]); } }
वापसी का टिकट
String[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट के वर्टिकल अलाइनमेंट का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getWidth()
यह फ़ंक्शन, कॉलम में मौजूद रेंज की चौड़ाई दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Gets the width of the range in number of columns and logs it to the console. console.log(range.getWidth());
वापसी का टिकट
Integer — रेंज में कॉलम की संख्या.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getWrap()
इससे यह पता चलता है कि सेल में मौजूद टेक्स्ट रैप होता है या नहीं. ज़्यादा सटीक रैप रणनीति के लिए, getWrapStrategy() का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.getWrap());
वापसी का टिकट
Boolean — इस सेल में मौजूद टेक्स्ट रैप होता है या नहीं.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getWrapStrategies()
इस फ़ंक्शन की मदद से, रेंज में मौजूद सेल के लिए टेक्स्ट रैपिंग की रणनीतियां मिलती हैं.
// Get the text wrapping strategies for all cells in range B5:C6 const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B5:C6'); const strategies = range.getWrapStrategies(); for (let i = 0; i < strategies.length; i++) { for (let j = 0; j < strategies[i].length; j++) { Logger.log(strategies[i][j]); } }
वापसी का टिकट
WrapStrategy[][] — यह टेक्स्ट रैपिंग की रणनीतियों का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getWrapStrategy()
यह फ़ंक्शन, रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए टेक्स्ट रैपिंग की रणनीति दिखाता है.
// Get the text wrapping strategy of cell B1. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B1:D4'); Logger.log(range.getWrapStrategy());
वापसी का टिकट
WrapStrategy — रेंज में सबसे ऊपर मौजूद बाएं सेल के लिए, टेक्स्ट रैपिंग की रणनीति.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getWraps()
इससे यह पता चलता है कि सेल में मौजूद टेक्स्ट रैप होता है या नहीं. ज़्यादा सटीक रैप रणनीति के लिए, getWrapStrategies() का इस्तेमाल करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); const results = range.getVerticalAlignments(); for (const i in results) { for (const j in results[i]) { const isWrapped = results[i][j]; if (isWrapped) { Logger.log('Cell [%s, %s] has wrapped text', i, j); } } }
वापसी का टिकट
Boolean[][] — यह रेंज में मौजूद सेल से जुड़े टेक्स्ट के वर्टिकल अलाइनमेंट का दो डाइमेंशन वाला कलेक्शन होता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertCells(shiftDimension)
इस रेंज में खाली सेल जोड़ता है. नई सेल में, इस रेंज में पहले से मौजूद सेल की फ़ॉर्मैटिंग बरकरार रहती है. शीट में मौजूद मौजूदा डेटा, दिए गए डाइमेंशन के साथ, डाली गई रेंज से दूर चला जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:D10'); range.insertCells(SpreadsheetApp.Dimension.COLUMNS);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
shift | Dimension | वह डाइमेंशन जिसके हिसाब से मौजूदा डेटा को शिफ़्ट करना है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertCheckboxes()
यह फ़ंक्शन, रेंज में मौजूद हर सेल में चेकबॉक्स डालता है. इन चेकबॉक्स को इस तरह कॉन्फ़िगर किया जाता है कि चुने गए चेकबॉक्स के लिए true और नहीं चुने गए चेकबॉक्स के लिए false दिखे. इस फ़ंक्शन का इस्तेमाल करके, रेंज में मौजूद सभी सेल की वैल्यू को false पर सेट किया जाता है.
const range = SpreadsheetApp.getActive().getRange('A1:B10'); // Inserts checkboxes into each cell in the range A1:B10 configured with 'true' // for checked and 'false' for unchecked. Also, sets the value of each cell in // the range A1:B10 to 'false'. range.insertCheckboxes();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertCheckboxes(checkedValue)
यह फ़ंक्शन, रेंज की हर सेल में चेकबॉक्स डालता है. इसमें, चुने गए चेकबॉक्स के लिए कस्टम वैल्यू और नहीं चुने गए चेकबॉक्स के लिए खाली स्ट्रिंग कॉन्फ़िगर की जाती है. इस फ़ंक्शन का इस्तेमाल करके, रेंज में मौजूद हर सेल की वैल्यू को खाली स्ट्रिंग पर सेट किया जाता है.
const range = SpreadsheetApp.getActive().getRange('A1:B10'); // Inserts checkboxes into each cell in the range A1:B10 configured with 'yes' // for checked and the empty string for unchecked. Also, sets the value of each // cell in the range A1:B10 to // the empty string. range.insertCheckboxes('yes');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
checked | Object | चेकबॉक्स के डेटा की पुष्टि करने के लिए, चुने गए विकल्प की वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
insertCheckboxes(checkedValue, uncheckedValue)
यह फ़ंक्शन, रेंज की हर सेल में चेकबॉक्स डालता है. इन चेकबॉक्स को, चुने गए और नहीं चुने गए स्टेटस के लिए कस्टम वैल्यू के साथ कॉन्फ़िगर किया जाता है. इस फ़ंक्शन की मदद से, रेंज में मौजूद हर सेल की वैल्यू को, कस्टम तौर पर चुनी गई ऐसी वैल्यू पर सेट किया जाता है जिसे चुना नहीं गया है.
const range = SpreadsheetApp.getActive().getRange('A1:B10'); // Inserts checkboxes into each cell in the range A1:B10 configured with 'yes' // for checked and 'no' for unchecked. Also, sets the value of each cell in the // range A1:B10 to 'no'. range.insertCheckboxes('yes', 'no');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
checked | Object | चेकबॉक्स के डेटा की पुष्टि करने के लिए, चुने गए विकल्प की वैल्यू. |
unchecked | Object | चेकबॉक्स के डेटा की पुष्टि करने के लिए, 'नहीं चुना गया' वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isBlank()
अगर रेंज पूरी तरह से खाली है, तो true दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D4'); Logger.log(range.isBlank());
वापसी का टिकट
Boolean — अगर रेंज खाली है, तो true; अगर रेंज खाली नहीं है, तो false.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isChecked()
यह फ़ंक्शन बताता है कि रेंज में मौजूद सभी सेल में चेकबॉक्स की स्थिति 'चुना गया' के तौर पर सेट है या नहीं. अगर कुछ सेल चुने गए हैं और कुछ नहीं चुने गए हैं या कुछ सेल में चेकबॉक्स वाला डेटा पुष्टि करने की सुविधा नहीं है, तो null वैल्यू मिलती है.
const range = SpreadsheetApp.getActive().getRange('A1:A3'); // Inserts checkboxes and sets each cell value to 'no' in the range A1:A3. range.insertCheckboxes('yes', 'no'); const range1 = SpreadsheetApp.getActive().getRange('A1'); range1.setValue('yes'); // Sets the value of isRange1Checked as true as it contains the checked value. const isRange1Checked = range1.isChecked(); const range2 = SpreadsheetApp.getActive().getRange('A2'); range2.setValue('no'); // Sets the value of isRange2Checked as false as it contains the unchecked // value. const isRange2Checked = range2.isChecked(); const range3 = SpreadsheetApp.getActive().getRange('A3'); range3.setValue('random'); // Sets the value of isRange3Checked as null, as it contains an invalid checkbox // value. const isRange3Checked = range3.isChecked();
वापसी का टिकट
Boolean — true, अगर रेंज की सभी सेल चुने गए हैं, false अगर रेंज की सभी सेल नहीं चुने गए हैं या null अगर कोई भी सेल नहीं चुना गया है या उसमें चेकबॉक्स डेटा की पुष्टि करने की सुविधा नहीं है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isEndColumnBounded()
इससे यह तय होता है कि रेंज का आखिरी हिस्सा किसी कॉलम से जुड़ा है या नहीं. उदाहरण के लिए, रेंज के आखिर में मौजूद कॉलम से बंधी हुई रेंज A1:B10 या B:B के लिए, यह तरीका true दिखाता है. वहीं, रेंज के आखिर में मौजूद सिर्फ़ कुछ पंक्तियों से बंधी हुई रेंज 3:7 या A1:5 के लिए, यह तरीका false दिखाता है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Determines if the end of the range is bound to a particular column and logs // it to the console. console.log(range.isEndColumnBounded());
वापसी का टिकट
Boolean — true अगर रेंज का आखिरी हिस्सा किसी कॉलम से जुड़ा है; false
अन्यथा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isEndRowBounded()
इससे यह तय किया जाता है कि रेंज का आखिरी हिस्सा किसी खास लाइन से जुड़ा है या नहीं. उदाहरण के लिए, A1:B10 या 3:7 रेंज के लिए, यह तरीका true दिखाता है. ये रेंज, रेंज के आखिर में मौजूद लाइनों से जुड़ी होती हैं. वहीं, B:B या A1:C रेंज के लिए, यह तरीका false दिखाता है. ये रेंज, रेंज के आखिर में मौजूद सिर्फ़ कुछ कॉलम से जुड़ी होती हैं.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Determines if the end of the range is bound to a particular row and logs it // to the console. console.log(range.isEndRowBounded());
वापसी का टिकट
Boolean — true अगर रेंज का आखिरी हिस्सा किसी खास लाइन से जुड़ा है; false
अन्यथा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isPartOfMerge()
अगर मौजूदा रेंज में मौजूद सेल, मर्ज की गई किसी सेल से ओवरलैप होती हैं, तो true दिखाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:B3'); // True if any of the cells in A1:B3 is included in a merge. const isPartOfMerge = range.isPartOfMerge();
वापसी का टिकट
Boolean — अगर रेंज, मर्ज किए गए किसी सेल से ओवरलैप होती है, तो true दिखाता है. ऐसा न होने पर, false दिखाता है.
isStartColumnBounded()
इस विकल्प से यह तय होता है कि रेंज की शुरुआत किसी कॉलम से जुड़ी है या नहीं. उदाहरण के लिए, A1:B10 या B:B रेंज के लिए, यह तरीका true दिखाता है. ये रेंज, रेंज की शुरुआत में मौजूद कॉलम से जुड़ी होती हैं. वहीं, 3:7 रेंज के लिए, यह तरीका false दिखाता है. यह रेंज, रेंज की शुरुआत में मौजूद सिर्फ़ एक लाइन से जुड़ी होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Determines if the start of the range is bound to a particular column and logs // it to the console. console.log(range.isStartColumnBounded());
वापसी का टिकट
Boolean — अगर रेंज की शुरुआत किसी कॉलम से जुड़ी है, तो true; false
अन्यथा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isStartRowBounded()
इससे यह तय होता है कि रेंज की शुरुआत किसी खास लाइन से जुड़ी है या नहीं. उदाहरण के लिए, A1:B10 या 3:7 रेंज के लिए, यह तरीका true दिखाता है. ये रेंज, रेंज की शुरुआत में मौजूद लाइनों से जुड़ी होती हैं. वहीं, B:B रेंज के लिए, यह तरीका false दिखाता है. यह रेंज, रेंज की शुरुआत में मौजूद किसी खास कॉलम से जुड़ी होती है.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can use SpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets the range A1:D10 on Sheet1. const range = sheet.getRange('A1:D10'); // Determines if the start of the range is bound to a particular row and logs it // to the console. console.log(range.isStartRowBounded());
वापसी का टिकट
Boolean — अगर रेंज की शुरुआत किसी खास लाइन से बंधी है, तो true; false
अन्यथा.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
merge()
यह फ़ंक्शन, रेंज में मौजूद सेल को एक साथ मिलाकर एक ब्लॉक बना देता है.
const sheet = SpreadsheetApp.getActiveSheet(); // The code below 2-dimensionally merges the cells in A1 to B3 sheet.getRange('A1:B3').merge();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
mergeAcross()
रेंज के कॉलम में मौजूद सेल को मर्ज करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The code below merges cells C5:E5 into one cell const range1 = sheet.getRange('C5:E5'); range1.mergeAcross(); // The code below creates 2 horizontal cells, F5:H5 and F6:H6 const range2 = sheet.getRange('F5:H6'); range2.mergeAcross();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
mergeVertically()
यह फ़ंक्शन, रेंज में मौजूद सेल को एक साथ मर्ज करता है.
const sheet = SpreadsheetApp.getActiveSheet(); // The code below vertically merges the cells in A1 to A10 sheet.getRange('A1:A10').mergeVertically(); // The code below creates 3 merged columns: B1 to B10, C1 to C10, and D1 to D10 sheet.getRange('B1:D10').mergeVertically();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
moveTo(target)
इस रेंज से टारगेट रेंज में, कट और चिपकाएं. इसमें फ़ॉर्मैट और वैल्यू, दोनों शामिल हैं.
// The code below moves the first 5 columns over to the 6th column const sheet = SpreadsheetApp.getActiveSheet(); sheet.getRange('A1:E').moveTo(sheet.getRange('F1'));
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
target | Range | यह वह टारगेट रेंज है जिसमें इस रेंज को कॉपी करना है. इसमें सिर्फ़ सबसे ऊपर बाईं ओर मौजूद सेल की पोज़िशन काम की होती है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
offset(rowOffset, columnOffset)
यह फ़ंक्शन, एक नई रेंज दिखाता है. यह रेंज, दी गई पंक्तियों और कॉलम की संख्या के हिसाब से इस रेंज से ऑफ़सेट होती है. पंक्तियों और कॉलम की संख्या नेगेटिव भी हो सकती है. नई रेंज का साइज़, ओरिजनल रेंज के साइज़ के बराबर होता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('A1'); // newCell references B2 const newCell = cell.offset(1, 1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह रेंज की सबसे ऊपर मौजूद बाईं ओर की सेल से नीचे की ओर मौजूद पंक्तियों की संख्या होती है. नेगेटिव वैल्यू, रेंज की सबसे ऊपर मौजूद बाईं ओर की सेल से ऊपर की ओर मौजूद पंक्तियों को दिखाती हैं. |
column | Integer | यह रेंज की सबसे ऊपर मौजूद बाईं ओर वाली सेल से दाईं ओर मौजूद कॉलम की संख्या होती है. नेगेटिव वैल्यू का मतलब है कि रेंज की सबसे ऊपर मौजूद बाईं ओर वाली सेल से बाईं ओर मौजूद कॉलम की संख्या. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
offset(rowOffset, columnOffset, numRows)
यह फ़ंक्शन, मौजूदा रेंज के हिसाब से एक नई रेंज दिखाता है. इस नई रेंज का सबसे ऊपर मौजूद बायां पॉइंट, मौजूदा रेंज से दी गई पंक्तियों और कॉलम के हिसाब से ऑफ़सेट होता है. साथ ही, इसकी ऊंचाई, सेल में दी गई ऊंचाई के बराबर होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('A1'); // newCell references B2:B3 const newRange = cell.offset(1, 1, 2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह रेंज की सबसे ऊपर मौजूद बाईं ओर की सेल से नीचे की ओर मौजूद पंक्तियों की संख्या होती है. नेगेटिव वैल्यू, रेंज की सबसे ऊपर मौजूद बाईं ओर की सेल से ऊपर की ओर मौजूद पंक्तियों को दिखाती हैं. |
column | Integer | यह रेंज की सबसे ऊपर मौजूद बाईं ओर वाली सेल से दाईं ओर मौजूद कॉलम की संख्या होती है. नेगेटिव वैल्यू का मतलब है कि रेंज की सबसे ऊपर मौजूद बाईं ओर वाली सेल से बाईं ओर मौजूद कॉलम की संख्या. |
num | Integer | नई रेंज की ऊंचाई, पंक्तियों में. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
offset(rowOffset, columnOffset, numRows, numColumns)
यह फ़ंक्शन, मौजूदा रेंज के हिसाब से एक नई रेंज दिखाता है. इस नई रेंज का ऊपरी-बायां कोना, मौजूदा रेंज से दी गई पंक्तियों और कॉलम के हिसाब से ऑफ़सेट होता है. साथ ही, इसकी ऊंचाई और चौड़ाई, सेल में दी गई ऊंचाई और चौड़ाई के हिसाब से होती है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('A1'); // newCell references B2:C3 const newRange = cell.offset(1, 1, 2, 2);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
row | Integer | यह रेंज की सबसे ऊपर मौजूद बाईं ओर की सेल से नीचे की ओर मौजूद पंक्तियों की संख्या होती है. नेगेटिव वैल्यू, रेंज की सबसे ऊपर मौजूद बाईं ओर की सेल से ऊपर की ओर मौजूद पंक्तियों को दिखाती हैं. |
column | Integer | यह रेंज की सबसे ऊपर मौजूद बाईं ओर वाली सेल से दाईं ओर मौजूद कॉलम की संख्या होती है. नेगेटिव वैल्यू का मतलब है कि रेंज की सबसे ऊपर मौजूद बाईं ओर वाली सेल से बाईं ओर मौजूद कॉलम की संख्या. |
num | Integer | नई रेंज की ऊंचाई, पंक्तियों में. |
num | Integer | नई रेंज की चौड़ाई, कॉलम में. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
protect()
यह एक ऐसा ऑब्जेक्ट बनाता है जो रेंज को उन उपयोगकर्ताओं के अलावा किसी और से बदलाव करने से सुरक्षित रख सकता है जिनके पास अनुमति है. जब तक स्क्रिप्ट, रेंज के लिए संपादकों की सूची में बदलाव नहीं करती (Protection.removeEditor(emailAddress), Protection.removeEditor(user), Protection.removeEditors(emailAddresses), Protection.addEditor(emailAddress), Protection.addEditor(user), Protection.addEditors(emailAddresses) को कॉल करके या Protection.setDomainEdit(editable) के लिए नई वैल्यू सेट करके), तब तक अनुमतियां स्प्रेडशीट की अनुमतियों के जैसी ही होती हैं. इसका मतलब है कि रेंज को सुरक्षित नहीं किया गया है. अगर रेंज पहले से ही सुरक्षित है, तो यह तरीका सुरक्षित की गई एक नई रेंज बनाता है. यह नई रेंज, मौजूदा रेंज से ओवरलैप होती है. अगर किसी सेल को सुरक्षित की गई कई रेंज से सुरक्षित किया गया है और उनमें से कोई भी रेंज किसी उपयोगकर्ता को सेल में बदलाव करने से रोकती है, तो उस उपयोगकर्ता को सेल में बदलाव करने की अनुमति नहीं दी जाती.
// Protect range A1:B10, then remove all other users from the list of editors. const ss = SpreadsheetApp.getActive(); const range = ss.getRange('A1:B10'); const protection = range.protect().setDescription('Sample protected range'); // Ensure the current user is an editor before removing others. Otherwise, if // the user's edit permission comes from a group, the script throws an exception // upon removing the group. const me = Session.getEffectiveUser(); protection.addEditor(me); protection.removeEditors(protection.getEditors()); if (protection.canDomainEdit()) { protection.setDomainEdit(false); }
वापसी का टिकट
Protection — यह सुरक्षा सेटिंग को दिखाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
randomize()
यह फ़ंक्शन, दी गई रेंज में मौजूद पंक्तियों के क्रम को रैंडम तरीके से बदलता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:C7'); // Randomizes the range range.randomize();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeCheckboxes()
इस फ़ंक्शन की मदद से, रेंज से सभी चेकबॉक्स हटाए जाते हैं. इससे हर सेल में डेटा की पुष्टि करने की सुविधा बंद हो जाती है. साथ ही, अगर सेल में चुनी गई या नहीं चुनी गई वैल्यू मौजूद है, तो उसे भी मिटा दिया जाता है.
const range = SpreadsheetApp.getActive().getRange('A1:B10'); // Inserts checkboxes and sets each cell value to 'no' in the range A1:B10. range.insertCheckboxes('yes', 'no'); const range1 = SpreadsheetApp.getActive().getRange('A1'); range1.setValue('yes'); // Removes the checkbox data validation in cell A1 and clears its value. range1.removeCheckboxes(); const range2 = SpreadsheetApp.getActive().getRange('A2'); range2.setValue('random'); // Removes the checkbox data validation in cell A2 but does not clear its value. range2.removeCheckboxes();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeDuplicates()
इस रेंज में मौजूद उन लाइनों को हटाता है जिनमें ऐसी वैल्यू होती हैं जो किसी पिछली लाइन में मौजूद वैल्यू की डुप्लीकेट होती हैं. एक जैसी वैल्यू वाली लाइनें डुप्लीकेट मानी जाती हैं. भले ही, उनमें फ़ॉर्मूला, फ़ॉर्मैट या अक्षर के साइज़ अलग-अलग हों. इस तरीके से, डुप्लीकेट पंक्तियों को भी हटाया जाता है. ये पंक्तियां, फ़िल्टर की वजह से छिपी होती हैं. इस रेंज के बाहर मौजूद कॉन्टेंट नहीं हटाया जाता.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B1:D7'); // Remove duplicate rows in the range. range.removeDuplicates();
वापसी का टिकट
Range — डुप्लीकेट वैल्यू हटाने के बाद मिली रेंज. हर पंक्ति को हटाने पर, रेंज का साइज़ एक पंक्ति कम हो जाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
removeDuplicates(columnsToCompare)
इस रेंज में मौजूद उन लाइनों को हटाता है जिनमें बताए गए कॉलम में ऐसी वैल्यू मौजूद होती हैं जो किसी पिछली लाइन में मौजूद वैल्यू की डुप्लीकेट होती हैं. एक जैसी वैल्यू वाली पंक्तियां डुप्लीकेट मानी जाती हैं. भले ही, उनमें फ़ॉर्मूला, फ़ॉर्मैट या अक्षर के साइज़ अलग-अलग हों. इस तरीके से, छिपी हुई डुप्लीकेट पंक्तियां भी हट जाती हैं. उदाहरण के लिए, फ़िल्टर की वजह से छिपी हुई पंक्तियां. इस रेंज के बाहर मौजूद कॉन्टेंट नहीं हटाया जाता.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B1:D7'); // Remove rows which have duplicate values in column B. range.removeDuplicates([2]); // Remove rows which have duplicate values in both columns B and D. range.removeDuplicates([2, 4]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
columns | Integer[] | डुप्लीकेट वैल्यू का पता लगाने के लिए, इन कॉलम का विश्लेषण किया जाता है. अगर कोई कॉलम नहीं दिया गया है, तो डुप्लीकेट वैल्यू का पता लगाने के लिए सभी कॉलम का विश्लेषण किया जाता है. |
वापसी का टिकट
Range — डुप्लीकेट वैल्यू हटाने के बाद मिली रेंज. हर पंक्ति को हटाने पर, रेंज का साइज़ एक पंक्ति कम हो जाता है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBackground(color)
इस विकल्प से, सीएसएस नोटेशन में रेंज की सभी सेल के बैकग्राउंड का रंग सेट किया जाता है. जैसे, '#ffffff'
या 'white'.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('B2:D5'); range.setBackground('red');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | String | सीएसएस नोटेशन में कलर कोड (जैसे, '#ffffff' या 'white'); null वैल्यू से रंग रीसेट हो जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBackgroundObject(color)
इस विकल्प का इस्तेमाल करके, रेंज में मौजूद सभी सेल के बैकग्राउंड का रंग सेट किया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const bgColor = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.BACKGROUND) .build(); const range = sheet.getRange('B2:D5'); range.setBackgroundObject(bgColor);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | Color | सेट करने के लिए बैकग्राउंड का रंग; null वैल्यू, बैकग्राउंड के रंग को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBackgroundObjects(color)
बैकग्राउंड के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const colorAccent1 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1) .build(); const colorAccent2 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT2) .build(); const colorAccent3 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT3) .build(); const colorAccent4 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT4) .build(); const colors = [ [colorAccent1, colorAccent2], [colorAccent3, colorAccent4], ]; const cell = sheet.getRange('B5:C6'); cell.setBackgroundObjects(colors);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | Color[][] | यह रंगों का दो डाइमेंशन वाला कलेक्शन होता है. null वैल्यू से रंग रीसेट हो जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBackgroundRGB(red, green, blue)
इस विकल्प का इस्तेमाल करके, आरजीबी वैल्यू (0 से 255 के बीच के पूर्णांक) का इस्तेमाल करके, बैकग्राउंड को दिए गए रंग पर सेट किया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); // Sets the background to white cell.setBackgroundRGB(255, 255, 255); // Sets the background to red cell.setBackgroundRGB(255, 0, 0);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
red | Integer | आरजीबी नोटेशन में लाल रंग की वैल्यू. |
green | Integer | आरजीबी नोटेशन में हरे रंग की वैल्यू. |
blue | Integer | आरजीबी नोटेशन में नीले रंग की वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBackgrounds(color)
बैकग्राउंड के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. कलर, सीएसएस नोटेशन में हैं. जैसे, '#ffffff' या 'white'.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const colors = [ ['red', 'white', 'blue'], ['#FF0000', '#FFFFFF', '#0000FF'], // These are the hex equivalents ]; const cell = sheet.getRange('B5:D6'); cell.setBackgrounds(colors);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | String[][] | सीएसएस नोटेशन में रंगों का दो डाइमेंशनल ऐरे (जैसे, '#ffffff' या
'white'); null वैल्यू, रंग को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBorder(top, left, bottom, right, vertical, horizontal)
बॉर्डर प्रॉपर्टी सेट करता है. मान्य वैल्यू true (चालू है), false (बंद है), और null (कोई बदलाव नहीं) हैं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); // Sets borders on the top and bottom, but leaves the left and right unchanged cell.setBorder(true, null, true, null, false, false);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
top | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
left | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
bottom | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
right | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
vertical | Boolean | true का इस्तेमाल अंदरूनी वर्टिकल बॉर्डर के लिए, false का इस्तेमाल किसी भी बॉर्डर के लिए नहीं, और null का इस्तेमाल कोई बदलाव न करने के लिए किया जाता है. |
horizontal | Boolean | true का इस्तेमाल अंदरूनी हॉरिज़ॉन्टल बॉर्डर के लिए, false का इस्तेमाल किसी भी बॉर्डर के लिए नहीं, और null का इस्तेमाल कोई बदलाव न करने के लिए करें. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setBorder(top, left, bottom, right, vertical, horizontal, color, style)
इस विकल्प की मदद से, बॉर्डर की प्रॉपर्टी को रंग और/या स्टाइल के साथ सेट किया जाता है. मान्य वैल्यू true (चालू है), false (बंद है), और null (कोई बदलाव नहीं) हैं. रंग के लिए, सीएसएस नोटेशन में रंग का इस्तेमाल करें. जैसे, '#ffffff' या 'white'.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); // Sets borders on the top and bottom, but leaves the left and right unchanged // Also sets the color to "red", and the border to "DASHED". cell.setBorder( true, null, true, null, false, false, 'red', SpreadsheetApp.BorderStyle.DASHED, );
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
top | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
left | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
bottom | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
right | Boolean | बॉर्डर के लिए true, किसी भी बॉर्डर के लिए false, और कोई बदलाव न करने के लिए null. |
vertical | Boolean | true का इस्तेमाल अंदरूनी वर्टिकल बॉर्डर के लिए, false का इस्तेमाल किसी भी बॉर्डर के लिए नहीं, और null का इस्तेमाल कोई बदलाव न करने के लिए किया जाता है. |
horizontal | Boolean | true का इस्तेमाल अंदरूनी हॉरिज़ॉन्टल बॉर्डर के लिए, false का इस्तेमाल किसी भी बॉर्डर के लिए नहीं, और null का इस्तेमाल कोई बदलाव न करने के लिए करें. |
color | String | सीएसएस नोटेशन में रंग (जैसे, '#ffffff' या 'white'), डिफ़ॉल्ट रंग (काला) के लिए null. |
style | Border | बॉर्डर के लिए स्टाइल, डिफ़ॉल्ट स्टाइल (सॉलिड) के लिए null. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setDataValidation(rule)
यह फ़ंक्शन, रेंज में मौजूद सभी सेल के लिए डेटा की पुष्टि करने का एक नियम सेट करता है.
// Set the data validation rule for cell A1 to require a value from B1:B10. const cell = SpreadsheetApp.getActive().getRange('A1'); const range = SpreadsheetApp.getActive().getRange('B1:B10'); const rule = SpreadsheetApp.newDataValidation().requireValueInRange(range).build(); cell.setDataValidation(rule);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
rule | Data | डेटा की पुष्टि करने का नियम सेट करने के लिए, यह विकल्प इस्तेमाल करें. डेटा की पुष्टि करने की सुविधा हटाने के लिए, null का इस्तेमाल करें. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setDataValidations(rules)
यह फ़ंक्शन, रेंज में मौजूद सभी सेल के लिए डेटा की पुष्टि करने के नियम सेट करता है. इस तरीके में, डेटा की पुष्टि के नियमों का दो डाइमेंशन वाला अरे लिया जाता है. इसे पहले पंक्ति के हिसाब से और फिर कॉलम के हिसाब से इंडेक्स किया जाता है. ऐरे के डाइमेंशन, रेंज के डाइमेंशन से मेल खाने चाहिए.
// Set the data validation rules for Sheet1!A1:B5 to require a value from // Sheet2!A1:A10. const destinationRange = SpreadsheetApp.getActive().getSheetByName('Sheet1').getRange('A1:B5'); const sourceRange = SpreadsheetApp.getActive().getSheetByName('Sheet2').getRange('A1:A10'); const rule = SpreadsheetApp.newDataValidation().requireValueInRange(sourceRange).build(); const rules = destinationRange.getDataValidations(); for (let i = 0; i < rules.length; i++) { for (let j = 0; j < rules[i].length; j++) { rules[i][j] = rule; } } destinationRange.setDataValidations(rules);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
rules | Data | डेटा की पुष्टि के लिए सेट किए जाने वाले नियमों की दो डाइमेंशन वाली ऐरे; null वैल्यू
डेटा की पुष्टि करने की सुविधा हटाती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontColor(color)
इससे सीएसएस नोटेशन (जैसे कि '#ffffff' या 'white') में फ़ॉन्ट का रंग सेट किया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setFontColor('red');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | String | सीएसएस नोटेशन में फ़ॉन्ट का रंग (जैसे, '#ffffff' या 'white'); null वैल्यू, रंग को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontColorObject(color)
इससे दी गई रेंज के फ़ॉन्ट का रंग सेट किया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const color = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.TEXT) .build(); const cell = sheet.getRange('B2'); cell.setFontColor(color);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
color | Color | सेट करने के लिए फ़ॉन्ट का रंग; null वैल्यू से रंग रीसेट हो जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontColorObjects(colors)
यह फ़ॉन्ट के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const colorAccent1 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1) .build(); const colorAccent2 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT2) .build(); const colorAccent3 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT3) .build(); const colorAccent4 = SpreadsheetApp.newColor() .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT4) .build(); const colors = [ [colorAccent1, colorAccent2], [colorAccent3, colorAccent4], ]; const cell = sheet.getRange('B5:C6'); cell.setFontColorObjects(colors);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
colors | Color[][] | यह रंगों का दो डाइमेंशन वाला कलेक्शन होता है. null वैल्यू, फ़ॉन्ट के रंग को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontColors(colors)
यह फ़ॉन्ट के रंगों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. रंग, सीएसएस नोटेशन में होते हैं. जैसे, '#ffffff' या 'white'.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const colors = [ ['red', 'white', 'blue'], ['#FF0000', '#FFFFFF', '#0000FF'], // These are the hex equivalents ]; const cell = sheet.getRange('B5:D6'); cell.setFontColors(colors);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
colors | Object[][] | सीएसएस नोटेशन में रंगों का दो डाइमेंशनल ऐरे (जैसे, '#ffffff' या
'white'); null वैल्यू, रंग को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontFamilies(fontFamilies)
इससे फ़ॉन्ट फ़ैमिली की आयताकार ग्रिड सेट की जाती है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए. फ़ॉन्ट फ़ैमिली के उदाहरण "Arial" या "Helvetica" हैं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const fonts = [ ['Arial', 'Helvetica', 'Verdana'], ['Courier New', 'Arial', 'Helvetica'], ]; const cell = sheet.getRange('B2:D3'); cell.setFontFamilies(fonts);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | Object[][] | यह फ़ॉन्ट फ़ैमिली का दो डाइमेंशन वाला कलेक्शन है. null वैल्यू, फ़ॉन्ट फ़ैमिली को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontFamily(fontFamily)
इससे फ़ॉन्ट फ़ैमिली सेट की जाती है. जैसे, "Arial" या "Helvetica".
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setFontFamily('Helvetica');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | String | सेट की जाने वाली फ़ॉन्ट फ़ैमिली; null वैल्यू, फ़ॉन्ट फ़ैमिली को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontLine(fontLine)
यह दिए गए रेंज ('underline', 'line-through' या 'none') के फ़ॉन्ट की लाइन स्टाइल सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setFontLine('line-through');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | String | फ़ॉन्ट की लाइन स्टाइल, 'underline', 'line-through' या 'none' में से कोई एक; null वैल्यू, फ़ॉन्ट की लाइन स्टाइल को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontLines(fontLines)
लाइन स्टाइल की आयताकार ग्रिड सेट करता है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const fontLines = [['underline', 'line-through', 'none']]; const range = sheet.getRange('B2:D2'); range.setFontLines(fontLines);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | Object[][] | फ़ॉन्ट की लाइन स्टाइल ('underline', 'line-through' या 'none') का दो डाइमेंशन वाला ऐरे; null वैल्यू, फ़ॉन्ट की लाइन स्टाइल को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontSize(size)
इससे फ़ॉन्ट का साइज़ सेट किया जाता है. साइज़, इस्तेमाल किया जाने वाला पॉइंट साइज़ होता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setFontSize(20);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
size | Integer | पॉइंट साइज़ में फ़ॉन्ट का साइज़. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontSizes(sizes)
इससे फ़ॉन्ट साइज़ की आयताकार ग्रिड सेट की जाती है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. साइज़ पॉइंट में दिए गए हैं.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const fontSizes = [[16, 20, 24]]; const range = sheet.getRange('B2:D2'); range.setFontSizes(fontSizes);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sizes | Object[][] | साइज़ का दो डाइमेंशन वाला कलेक्शन. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontStyle(fontStyle)
दी गई रेंज ('italic' या 'normal') के लिए फ़ॉन्ट स्टाइल सेट करें.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setFontStyle('italic');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | String | फ़ॉन्ट स्टाइल, 'italic' या 'normal' में से कोई एक; null वैल्यू, फ़ॉन्ट स्टाइल को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontStyles(fontStyles)
इससे फ़ॉन्ट स्टाइल की आयताकार ग्रिड सेट की जाती है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const fontStyles = [['italic', 'normal']]; const range = sheet.getRange('B2:C2'); range.setFontStyles(fontStyles);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | Object[][] | यह फ़ॉन्ट स्टाइल का दो डाइमेंशन वाला कलेक्शन है. यह 'italic' या 'normal' हो सकता है. null वैल्यू, फ़ॉन्ट स्टाइल को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontWeight(fontWeight)
दी गई रेंज के लिए फ़ॉन्ट वेट (सामान्य/बोल्ड) सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setFontWeight('bold');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | String | फ़ॉन्ट की मोटाई, 'bold' या 'normal'; null वैल्यू, फ़ॉन्ट की मोटाई को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFontWeights(fontWeights)
इससे फ़ॉन्ट वेट की रेक्टेंगुलर ग्रिड सेट की जाती है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. फ़ॉन्ट के वज़न का उदाहरण "बोल्ड" है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const fontStyles = [['bold', 'bold', 'normal']]; const range = sheet.getRange('B2:D2'); range.setFontWeights(fontStyles);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
font | Object[][] | फ़ॉन्ट वेट का दो डाइमेंशन वाला ऐरे, 'bold' या 'normal'; null वैल्यू, फ़ॉन्ट वेट को रीसेट करती हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFormula(formula)
इस रेंज के लिए फ़ॉर्मूला अपडेट करता है. दिया गया फ़ॉर्मूला, A1 नोटेशन में होना चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B5'); cell.setFormula('=SUM(B3:B4)');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
formula | String | यह स्ट्रिंग, सेल के लिए सेट किए जाने वाले फ़ॉर्मूले को दिखाती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFormulaR1C1(formula)
इस रेंज के लिए फ़ॉर्मूला अपडेट करता है. दिया गया फ़ॉर्मूला, R1C1 नोटेशन में होना चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B5'); // This sets the formula to be the sum of the 3 rows above B5 cell.setFormulaR1C1('=SUM(R[-3]C[0]:R[-1]C[0])');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
formula | String | स्ट्रिंग फ़ॉर्मूला. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFormulas(formulas)
फ़ॉर्मूलों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. दिए गए फ़ॉर्मूले, A1 नोटेशन में होने चाहिए. यह तरीका, फ़ॉर्मूलों के दो डाइमेंशन वाले कलेक्शन को लेता है. इसे पहले पंक्ति और फिर कॉलम के हिसाब से इंडेक्स किया जाता है. ऐरे के डाइमेंशन, रेंज के डाइमेंशन से मेल खाने चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This sets the formulas to be a row of sums, followed by a row of averages // right below. The size of the two-dimensional array must match the size of the // range. const formulas = [ ['=SUM(B2:B4)', '=SUM(C2:C4)', '=SUM(D2:D4)'], ['=AVERAGE(B2:B4)', '=AVERAGE(C2:C4)', '=AVERAGE(D2:D4)'], ]; const cell = sheet.getRange('B5:D6'); cell.setFormulas(formulas);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
formulas | String[][] | फ़ॉर्मूला की दो डाइमेंशन वाली स्ट्रिंग ऐरे. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFormulasR1C1(formulas)
फ़ॉर्मूलों की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. दिए गए फ़ॉर्मूले, R1C1 नोटेशन में होने चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // This creates formulas for a row of sums, followed by a row of averages. const sumOfRowsAbove = '=SUM(R[-3]C[0]:R[-1]C[0])'; const averageOfRowsAbove = '=AVERAGE(R[-4]C[0]:R[-2]C[0])'; // The size of the two-dimensional array must match the size of the range. const formulas = [ [sumOfRowsAbove, sumOfRowsAbove, sumOfRowsAbove], [averageOfRowsAbove, averageOfRowsAbove, averageOfRowsAbove], ]; const cell = sheet.getRange('B5:D6'); // This sets the formula to be the sum of the 3 rows above B5. cell.setFormulasR1C1(formulas);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
formulas | String[][] | R1C1 फ़ॉर्मैट में फ़ॉर्मूलों का दो डाइमेंशन वाला ऐरे. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setHorizontalAlignment(alignment)
दी गई रेंज के लिए, हॉरिज़ॉन्टल (बाएं से दाएं) अलाइनमेंट (बाएं/बीच में/दाएं) सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setHorizontalAlignment('center');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
alignment | String | अलाइनमेंट, 'left', 'center' या 'normal' में से कोई एक; null वैल्यू से अलाइनमेंट रीसेट हो जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setHorizontalAlignments(alignments)
यह हॉरिज़ॉन्टल अलाइनमेंट की रेक्टैंगुलर ग्रिड सेट करता है. setHorizontalAlignment(alignment) देखें
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const horizontalAlignments = [['left', 'right', 'center']]; const range = sheet.getRange('B2:D2'); range.setHorizontalAlignments(horizontalAlignments);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
alignments | Object[][] | यह अलाइनमेंट की दो डाइमेंशन वाली एक ऐसी ऐरे होती है जिसमें 'left', 'center' या 'normal' में से कोई एक वैल्यू होती है. null वैल्यू, अलाइनमेंट को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
setNote(note)
नोट को दी गई वैल्यू पर सेट करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setNote('This is a note');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
note | String | रेंज के लिए सेट की जाने वाली नोट वैल्यू; null वैल्यू से नोट हट जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setNotes(notes)
नोट की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const notes = [ ['it goes', 'like this', 'the fourth, the fifth'], ['the minor fall', 'and the', 'major lift'], ]; const cell = sheet.getRange('B2:D3'); cell.setNotes(notes);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
notes | Object[][] | नोट का दो डाइमेंशन वाला कलेक्शन; null वैल्यू से नोट हट जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
setNumberFormat(numberFormat)
इस विकल्प का इस्तेमाल करके, नंबर या तारीख के फ़ॉर्मैट को दी गई फ़ॉर्मैटिंग स्ट्रिंग के हिसाब से सेट किया जाता है. स्वीकार किए जाने वाले फ़ॉर्मैट पैटर्न के बारे में, Sheets API के दस्तावेज़ में बताया गया है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); // Always show 3 decimal points cell.setNumberFormat('0.000');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
number | String | नंबर फ़ॉर्मैट वाली स्ट्रिंग. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setNumberFormats(numberFormats)
यह फ़ंक्शन, नंबर या तारीख के फ़ॉर्मैट की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. ये वैल्यू, फ़ॉर्मैट पैटर्न स्ट्रिंग होती हैं. इनके बारे में Sheets API के दस्तावेज़ में बताया गया है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const formats = [['0.000', '0,000,000', '$0.00']]; const range = sheet.getRange('B2:D2'); range.setNumberFormats(formats);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
number | Object[][] | यह नंबर फ़ॉर्मैट का दो डाइमेंशन वाला कलेक्शन होता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRichTextValue(value)
इस फ़ंक्शन का इस्तेमाल करके, रेंज में मौजूद सेल के लिए रिच टेक्स्ट वैल्यू सेट की जाती है.
// Sets all cells in range B2:D4 to have the text "Hello world", with "Hello" // bolded. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B2:D4'); const bold = SpreadsheetApp.newTextStyle().setBold(true).build(); const richText = SpreadsheetApp.newRichTextValue() .setText('Hello world') .setTextStyle(0, 5, bold) .build(); range.setRichTextValue(richText);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
value | Rich | रिच टेक्स्ट की मनचाही वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setRichTextValues(values)
इससे रिच टेक्स्ट वैल्यू की आयताकार ग्रिड सेट की जाती है.
// Sets the cells in range A1:A2 to have Rich Text values. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('A1:A2'); const bold = SpreadsheetApp.newTextStyle().setBold(true).build(); const italic = SpreadsheetApp.newTextStyle().setItalic(true).build(); const richTextA1 = SpreadsheetApp.newRichTextValue() .setText('This cell is bold') .setTextStyle(bold) .build(); const richTextA2 = SpreadsheetApp.newRichTextValue() .setText('bold words, italic words') .setTextStyle(0, 11, bold) .setTextStyle(12, 24, italic) .build(); range.setRichTextValues([[richTextA1], [richTextA2]]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
values | Rich | रिच टेक्स्ट की वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setShowHyperlink(showHyperlink)
इससे यह सेट होता है कि रेंज में हाइपरलिंक दिखाए जाने चाहिए या नहीं.
// Opens the spreadsheet file by its URL. If you created your script from within // a Google Sheets file, you can useSpreadsheetApp.getActiveSpreadsheet() // instead. // TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); // Gets Sheet1 by its name. const sheet = ss.getSheetByName('Sheet1'); // Gets cell A30 and sets its hyperlink value. const range = sheet.getRange('A30'); range.setValue('https://www.example.com'); // Sets cell A30 to show hyperlinks. range.setShowHyperlink(true);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
show | Boolean | हाइपरलिंक दिखाना है या नहीं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextDirection(direction)
इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट की दिशा सेट की जाती है. अगर तय की गई दिशा null है, तो दिशा का अनुमान लगाया जाता है और फिर उसे सेट किया जाता है.
// Sets right-to-left text direction for the range. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B5:C6'); range.setTextDirection(SpreadsheetApp.TextDirection.RIGHT_TO_LEFT);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
direction | Text | टेक्स्ट की दिशा; अगर null दिशा सेट करने से पहले ही तय कर ली गई है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextDirections(directions)
इससे टेक्स्ट की दिशाओं का आयताकार ग्रिड सेट किया जाता है. अगर तय की गई दिशा null है, तो दिशा का अनुमान लगाया जाता है और फिर उसे सेट किया जाता है.
// Copies all of the text directions from range A1:B2 over to range C5:D6. const sheet = SpreadsheetApp.getActiveSheet(); const range1 = sheet.getRange('A1:B2'); const range2 = sheet.getRange('C5:D6'); range2.setTextRotations(range1.getTextDirections());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
directions | Text | टेक्स्ट की दिशाएं; अगर तय की गई दिशा null है, तो इसे सेट करने से पहले इसका अनुमान लगाया जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextRotation(degrees)
इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट रोटेशन की सेटिंग सेट की जाती हैं. इनपुट, स्टैंडर्ड टेक्स्ट ओरिएंटेशन और मनचाहे ओरिएंटेशन के बीच के कोण के हिसाब से होता है. शून्य का इनपुट यह दिखाता है कि टेक्स्ट को स्टैंडर्ड ओरिएंटेशन पर सेट किया गया है.
बाएं से दाएं की ओर लिखे जाने वाले टेक्स्ट के लिए, पॉज़िटिव ऐंगल घड़ी की उलटी दिशा में होते हैं. वहीं, दाएं से बाएं की ओर लिखे जाने वाले टेक्स्ट के लिए, ये घड़ी की दिशा में होते हैं.
// Sets all cell's in range B2:D4 to have text rotated up 45 degrees. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B2:D4'); range.setTextRotation(45);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
degrees | Integer | स्टैंडर्ड ओरिएंटेशन और मनचाहे ओरिएंटेशन के बीच का ऐंगल. बाएं से दाएं लिखे जाने वाले टेक्स्ट के लिए, पॉज़िटिव ऐंगल घड़ी की उलटी दिशा में होते हैं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextRotation(rotation)
इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट रोटेशन की सेटिंग सेट की जाती हैं.
// Sets all cell's in range B2:D4 to have the same text rotation settings as // cell A1. const sheet = SpreadsheetApp.getActiveSheet(); const rotation = sheet.getRange('A1').getTextRotation(); sheet.getRange('B2:D4').setTextRotation(rotation);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
rotation | Text | टेक्स्ट को घुमाने की सेटिंग. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextRotations(rotations)
इससे टेक्स्ट रोटेशन की आयताकार ग्रिड सेट की जाती है.
// Copies all of the text rotations from range A1:B2 over to range C5:D6. const sheet = SpreadsheetApp.getActiveSheet(); const range1 = sheet.getRange('A1:B2'); const range2 = sheet.getRange('C5:D6'); range2.setTextRotations(range1.getTextRotations());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
rotations | Text | टेक्स्ट को घुमाने की सेटिंग. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextStyle(style)
इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट स्टाइल सेट की जाती है.
// Sets the cells in range C5:D6 to have underlined size 15 font. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('C5:D6'); const style = SpreadsheetApp.newTextStyle().setFontSize(15).setUnderline(true).build(); range.setTextStyle(style);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
style | Text | टेक्स्ट की मनचाही स्टाइल. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setTextStyles(styles)
इससे टेक्स्ट स्टाइल का आयताकार ग्रिड सेट किया जाता है.
// Sets text styles for cells in range A1:B2 const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('A1:B2'); const bold = SpreadsheetApp.newTextStyle().setBold(true).build(); const otherStyle = SpreadsheetApp.newTextStyle() .setBold(true) .setUnderline(true) .setItalic(true) .setForegroundColor('#335522') .setFontSize(44) .build(); range.setTextStyles([ [bold, otherStyle], [otherStyle, bold], ]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
styles | Text | टेक्स्ट के लिए अपनी पसंद के स्टाइल. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setValue(value)
इस विकल्प का इस्तेमाल करके, रेंज की वैल्यू सेट की जाती है. वैल्यू, संख्या, स्ट्रिंग, बूलियन या तारीख हो सकती है. अगर यह '=' से शुरू होता है, तो इसे फ़ॉर्मूला माना जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setValue(100);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
value | Object | रेंज के लिए वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setValues(values)
वैल्यू की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए. अगर कोई वैल्यू = से शुरू होती है, तो उसे फ़ॉर्मूला माना जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const values = [['2.000', '1,000,000', '$2.99']]; const range = sheet.getRange('B2:D2'); range.setValues(values);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
values | Object[][] | वैल्यू का दो डाइमेंशन वाला अरे. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setVerticalAlignment(alignment)
दी गई रेंज के लिए, वर्टिकल (ऊपर से नीचे) अलाइनमेंट सेट करें (ऊपर/बीच में/नीचे).
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setVerticalAlignment('middle');
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
alignment | String | अलाइनमेंट, 'top', 'middle' या 'bottom' में से कोई एक; null वैल्यू, अलाइनमेंट को रीसेट करती है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setVerticalAlignments(alignments)
वर्टिकल अलाइनमेंट की आयताकार ग्रिड सेट करता है. यह ग्रिड, इस रेंज के डाइमेंशन से मेल खानी चाहिए.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const alignments = [['top', 'middle', 'bottom']]; const range = sheet.getRange('B2:D2'); range.setVerticalAlignments(alignments);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
alignments | Object[][] | यह अलाइनमेंट की दो डाइमेंशन वाली एक ऐसी ऐरे होती है जिसमें 'top', 'middle' या 'bottom' में से कोई एक वैल्यू होती है. null वैल्यू से अलाइनमेंट रीसेट हो जाता है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
setVerticalText(isVertical)
इस विकल्प से यह सेट किया जाता है कि रेंज में मौजूद सेल के टेक्स्ट को स्टैक करना है या नहीं. अगर टेक्स्ट को वर्टिकल तरीके से स्टैक किया जाता है, तो टेक्स्ट को घुमाने की सेटिंग को अनदेखा कर दिया जाता है.
// Sets all cell's in range B2:D4 to have vertically stacked text. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B2:D4'); range.setVerticalText(true);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
is | Boolean | टेक्स्ट को स्टैक करना है या नहीं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setWrap(isWrapEnabled)
इस फ़ंक्शन का इस्तेमाल करके, दी गई रेंज के सेल रैप को सेट किया जाता है.
टेक्स्ट रैप की सुविधा चालू होने पर (डिफ़ॉल्ट रूप से), सेल का साइज़ बदलकर पूरा कॉन्टेंट दिखाया जाता है. टेक्स्ट रैप की सुविधा बंद होने पर, सेल में मौजूद टेक्स्ट को सेल के साइज़ में बदलाव किए बिना या उसे कई लाइनों में बांटे बिना, ज़्यादा से ज़्यादा दिखाया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const cell = sheet.getRange('B2'); cell.setWrap(true);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
is | Boolean | टेक्स्ट रैप करना है या नहीं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setWrapStrategies(strategies)
यह रैप करने की रणनीतियों की आयताकार ग्रिड सेट करता है.
// Copies all of the wrap strategies from range A1:B2 over to range C5:D6. const sheet = SpreadsheetApp.getActiveSheet(); const range1 = sheet.getRange('A1:B2'); const range2 = sheet.getRange('C5:D6'); range2.setWrapStrategies(range1.getWrapStrategies());
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
strategies | Wrap | रैपिंग की पसंदीदा रणनीतियां. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setWrapStrategy(strategy)
इस विकल्प से, रेंज में मौजूद सेल के लिए टेक्स्ट रैपिंग की रणनीति सेट की जाती है.
// Sets all cells in range B2:D4 to use the clip wrap strategy. const sheet = SpreadsheetApp.getActiveSheet(); const range = sheet.getRange('B2:D4'); range.setWrapStrategy(SpreadsheetApp.WrapStrategy.CLIP);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
strategy | Wrap | रैपिंग का तरीका. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setWraps(isWrapEnabled)
इससे टेक्स्ट रैप करने की नीतियों की आयताकार ग्रिड सेट की जाती है. यह इस रेंज के डाइमेंशन से मेल खानी चाहिए. जिन सेल में रैप करने की सुविधा चालू होती है (डिफ़ॉल्ट रूप से चालू होती है), उनका साइज़ बदलकर पूरा कॉन्टेंट दिखाया जाता है. टेक्स्ट रैप की सुविधा बंद होने पर, सेल में जितना हो सके उतना टेक्स्ट दिखता है. इसके लिए, सेल का साइज़ नहीं बदला जाता और न ही टेक्स्ट को कई लाइनों में दिखाया जाता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; // The size of the two-dimensional array must match the size of the range. const wraps = [[true, true, false]]; const range = sheet.getRange('B2:D2'); range.setWraps(wraps);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
is | Object[][] | यह रैप वैरिएबल का दो डाइमेंशन वाला अरे होता है. इससे यह तय होता है कि किसी सेल में टेक्स्ट को रैप करना है या नहीं. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
इन्हें भी देखें
shiftColumnGroupDepth(delta)
यह फ़ंक्शन, तय की गई रकम के हिसाब से रेंज के कॉलम ग्रुपिंग की डेप्थ को बदलता है.
इससे रेंज में आने वाले ग्रुप बनाए, बदले या मिटाए जा सकते हैं. पॉज़िटिव डेल्टा के लिए, ग्रुप बनाए जाते हैं और/या उनमें बदलाव किया जाता है. नेगेटिव डेल्टा के लिए, ग्रुप मिटाए जाते हैं और/या उनमें बदलाव किया जाता है.
ग्रुप डेप्थ को शून्य से कम या आठ से ज़्यादा करने पर, इसका कोई असर नहीं पड़ता.
अगर column group control position BEFORE है, तो पहली लाइन की गहराई को बदलने की कोशिश करते समय गड़बड़ी होती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getActiveRange(); // The column grouping depth is increased by 1. range.shiftColumnGroupDepth(1); // The column grouping depth is decreased by 1. range.shiftColumnGroupDepth(-1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
delta | Integer | इस रेंज के कॉलम ग्रुप की डेप्थ में बदलाव करने के लिए वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
थ्रॉ
Error — जब कंट्रोल की पोज़िशन GroupControlTogglePosition.BEFORE हो, तब पहले कॉलम की डेप्थ को बदलने की कोशिश करने पर
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
shiftRowGroupDepth(delta)
यह फ़ंक्शन, तय की गई संख्या के हिसाब से रेंज की लाइन ग्रुपिंग की डेप्थ बदलता है.
इससे रेंज में आने वाले ग्रुप बनाए, बदले या मिटाए जा सकते हैं. पॉज़िटिव डेल्टा के लिए, ग्रुप बनाए जाते हैं और/या उनमें बदलाव किया जाता है. नेगेटिव डेल्टा के लिए, ग्रुप मिटाए जाते हैं और/या उनमें बदलाव किया जाता है.
ग्रुप डेप्थ को शून्य से कम या आठ से ज़्यादा करने पर, इसका कोई असर नहीं पड़ता.
अगर row group control position BEFORE है, तो पहली लाइन की गहराई को बदलने की कोशिश करते समय गड़बड़ी होती है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getActiveRange(); // The row grouping depth is increased by 1. range.shiftRowGroupDepth(1); // The row grouping depth is decreased by 1. range.shiftRowGroupDepth(-1);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
delta | Integer | इस रेंज के लिए, लाइन ग्रुप की डेप्थ में बदलाव करने की वैल्यू. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
थ्रॉ
Error — जब कंट्रोल की पोज़िशन GroupControlTogglePosition.BEFORE हो, तब पहली लाइन की डेप्थ को बदलने की कोशिश करने पर
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
sort(sortSpecObj)
यह फ़ंक्शन, दी गई रेंज में मौजूद सेल को तय किए गए कॉलम और क्रम के हिसाब से क्रमबद्ध करता है.
const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheets()[0]; const range = sheet.getRange('A1:C7'); // Sorts by the values in the first column (A) range.sort(1); // Sorts by the values in the second column (B) range.sort(2); // Sorts descending by column B range.sort({column: 2, ascending: false}); // Sorts descending by column B, then ascending by column A // Note the use of an array range.sort([ {column: 2, ascending: false}, {column: 1, ascending: true}, ]); // For rows that are sorted in ascending order, the "ascending" parameter is // optional, and just an integer with the column can be used instead. Note that // in general, keeping the sort specification consistent results in more // readable code. You can express the earlier sort as: range.sort([{column: 2, ascending: false}, 1]); // Alternatively, if you want all columns to be in ascending order, you can use // the following (this makes column 2 ascending) range.sort([2, 1]); // ... which is equivalent to range.sort([ {column: 2, ascending: true}, {column: 1, ascending: true}, ]);
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
sort | Object | वे कॉलम जिनके हिसाब से क्रम से लगाना है. |
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
splitTextToColumns()
यह फ़ंक्शन, टेक्स्ट वाले कॉलम को कई कॉलम में बांटता है. यह काम, अपने-आप पता लगाए गए डेलिमिटर के आधार पर किया जाता है.
// A1:A3 has the following values: // A B C // 1 |one,one,one | | | // 2 |two,two,two | | | // 3 |three,three,three| | | const range = SpreadsheetApp.getActiveSheet().getRange('A1:A3'); range.splitTextToColumns(); // Result after splitting the text to columns: // A B C // 1 |one |one |one | // 2 |two |two |two | // 3 |three |three |three |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
splitTextToColumns(delimiter)
इस फ़ंक्शन की मदद से, टेक्स्ट के किसी कॉलम को कई कॉलम में बांटा जा सकता है. इसके लिए, तय की गई स्ट्रिंग को कस्टम डेलिमिटर के तौर पर इस्तेमाल किया जाता है.
// A1:A3 has the following values: // A B C // 1 |one#one#one | | | // 2 |two#two#two | | | // 3 |three#three#three| | | const range = SpreadsheetApp.getActiveSheet().getRange('A1:A3'); range.splitTextToColumns('#'); // Result after splitting the text to columns: // A B C // 1 |one |one |one | // 2 |two |two |two | // 3 |three |three |three |
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
delimiter | String | वह कस्टम डेलिमीटर जिसके आधार पर टेक्स्ट को अलग-अलग हिस्सों में बांटा जाता है. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
splitTextToColumns(delimiter)
यह फ़ंक्शन, टेक्स्ट वाले कॉलम को तय किए गए डेलिमिटर के आधार पर कई कॉलम में बांटता है.
// A1:A3 has the following values: // A B C // 1 |one;one;one | | | // 2 |two;two;two | | | // 3 |three;three;three| | | const range = SpreadsheetApp.getActiveSheet().getRange('A1:A3'); range.splitTextToColumns(SpreadsheetApp.TextToColumnsDelimiter.SEMICOLON); // Result after splitting the text to columns: // A B C // 1 |one |one |one | // 2 |two |two |two | // 3 |three |three |three |
पैरामीटर
| नाम | टाइप | ब्यौरा |
|---|---|---|
delimiter | Text | स्ट्रिंग को बांटने के लिए, पहले से तय किया गया डेलिमिटर. |
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
trimWhitespace()
यह फ़ंक्शन, इस रेंज की हर सेल में मौजूद खाली जगह (जैसे कि स्पेस, टैब या नई लाइनें) को हटाता है. यह फ़ंक्शन, हर सेल के टेक्स्ट की शुरुआत और आखिर में मौजूद सभी खाली सफ़ेद जगहों को हटा देता है. साथ ही, बची हुई खाली सफ़ेद जगहों के किसी भी सबसीक्वेंस को एक स्पेस में बदल देता है.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const range = sheet.getRange('A1:A4'); range.activate(); range.setValues([ ' preceding space', 'following space ', 'two middle spaces', ' =SUM(1,2)', ]); range.trimWhitespace(); const values = range.getValues(); // Values are ['preceding space', 'following space', 'two middle spaces', // '=SUM(1,2)']
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
uncheck()
यह फ़ंक्शन, रेंज में मौजूद चेकबॉक्स की स्थिति को “unchecked” में बदल देता है. यह रेंज में मौजूद उन सेल को अनदेखा करता है जिनमें फ़िलहाल, कॉन्फ़िगर की गई checked या unchecked वैल्यू मौजूद नहीं है.
// Changes the state of cells which currently contain either the checked or // unchecked value configured in the range A1:B10 to 'unchecked'. const range = SpreadsheetApp.getActive().getRange('A1:B10'); range.uncheck();
वापसी का टिकट
Range — यह रेंज, चेन बनाने के लिए होती है.
अनुमति देना
इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, इनमें से एक या उससे ज़्यादा स्कोप के साथ अनुमति लेना ज़रूरी है:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets