range

google apps script: remove and restore protection

不想你离开。 提交于 2021-01-28 18:33:12
问题 I have a spreadsheet that is editable by everyone with a protected sheet with some ranges unprotected. I want cells that can be altered by a script run by any user (from a menu), but not manually. When I run the script not as the owner it gives an error message when I try to temporarily remove the protection. 回答1: There seems to be no easy way to do this, because functions run from the menu is always executed as "user at the keyboard". One workaround is to publish a Web App to always "Execute

Using VBA to create a single range from multiple ranges

依然范特西╮ 提交于 2021-01-28 11:41:34
问题 Hello this is my first post as I've always been able to find my answers in previous posts... until now. There must be a post, but I couldn't find one addressing the issue I'm having. My skill level is intermediate at best :-) I have some values in a tabular format. I want to create a range from that which excludes some rows. I felt like I was getting close with a union, but alas, no go. The code example is below. The result was a new range containing only the value of Rng1. Any suggestions

Python: Find outliers inside a list

谁说我不能喝 提交于 2021-01-28 09:59:03
问题 I'm having a list with a random amount of integers and/or floats. What I'm trying to achieve is to find the exceptions inside my numbers (hoping to use the right words to explain this). For example: list = [1, 3, 2, 14, 108, 2, 1, 8, 97, 1, 4, 3, 5] 90 to 99% of my integer values are between 1 and 20 sometimes there are values that are much higher, let's say somewhere around 100 or 1.000 or even more My problem is, that these values can be different all the time. Maybe the regular range is

“This command is not available.” error occurs when trying to execute PasteAndFormat function

孤街醉人 提交于 2021-01-28 04:10:47
问题 I published the VSTO app, where I copy a Range with a formatted text. On most users machines the application works properly while some users have the error "This command is not available." thrown whenever the following piece of code is being excetuded. var sourceDocument = Globals.ThisAddIn.Application.ActiveDocument; sourceDocument.Range().Copy(); Document documentOld = new Document(); documentOld.Range().PasteAndFormat(WdRecoveryType.wdFormatOriginalFormatting); //here the error occurs

Array of integers into array of ranges

心已入冬 提交于 2021-01-27 07:27:06
问题 I'm trying to figure out how I can change array of integers into array of ranges. For example I want to take this array: ar = [0, 49, 14, 30, 40, 23, 59, 101] into ar = [0..49, 14..30, 40..23, 59..101] Given array always will be even. I want to take each two values as borders of ranges. I have tried to seperate it for two arrays. One with odd indexes second with even. a = ar.select.with_index{|_,i| (i+1) % 2 == 1} b = ar.select.with_index{|_,i| (i+1) % 2 == 0} I don't have an idea how to use

Array of integers into array of ranges

早过忘川 提交于 2021-01-27 07:26:05
问题 I'm trying to figure out how I can change array of integers into array of ranges. For example I want to take this array: ar = [0, 49, 14, 30, 40, 23, 59, 101] into ar = [0..49, 14..30, 40..23, 59..101] Given array always will be even. I want to take each two values as borders of ranges. I have tried to seperate it for two arrays. One with odd indexes second with even. a = ar.select.with_index{|_,i| (i+1) % 2 == 1} b = ar.select.with_index{|_,i| (i+1) % 2 == 0} I don't have an idea how to use

Excel: dynamically calculate range next to a searched up cell

こ雲淡風輕ζ 提交于 2021-01-25 17:36:18
问题 I am an occasional Excel user and stuck how to create a dynamic range. After looking up a text in a table, how can I calculate the range next to this cell, up to the next empty row? Not using VBA. Thanks for your help. 回答1: In H4 , formula copied down : =IFERROR(INDEX(INDEX(C:C,MATCH(F4,A:A,0)):C$1000,MATCH(G4,INDEX(B:B,MATCH(F4,A:A,0)):B$1000,0)),"") Should you want a dynamic range , Change C$1000 to INDEX(C:C,MATCH(9.9E+307,B:B) and Change B$1000 to INDEX(B:B,MATCH(9.9E+307,B:B)) Then The

Excel: dynamically calculate range next to a searched up cell

删除回忆录丶 提交于 2021-01-25 17:23:32
问题 I am an occasional Excel user and stuck how to create a dynamic range. After looking up a text in a table, how can I calculate the range next to this cell, up to the next empty row? Not using VBA. Thanks for your help. 回答1: In H4 , formula copied down : =IFERROR(INDEX(INDEX(C:C,MATCH(F4,A:A,0)):C$1000,MATCH(G4,INDEX(B:B,MATCH(F4,A:A,0)):B$1000,0)),"") Should you want a dynamic range , Change C$1000 to INDEX(C:C,MATCH(9.9E+307,B:B) and Change B$1000 to INDEX(B:B,MATCH(9.9E+307,B:B)) Then The

What's the difference between a sentinel and an end iterator?

这一生的挚爱 提交于 2021-01-21 12:19:08
问题 While reading Eric Niebler's range proposal, I've come across the term sentinel as replacement for the end iterator. I'm having a difficult time understanding the benefits of sentinel over an end iterator. Could someone provide a clear example of what sentintel brings to the table that cannot be done with standard iterator pairs? "A sentinel is an abstraction of a past-the-end iterator. Sentinels are Regular types that can be used to denote the end of a range. A sentinel and an iterator

Dart: create a list from 0 to N

你。 提交于 2021-01-21 12:04:53
问题 How can I create easily a range of consecutive integers in dart? For example: // throws a syntax error :) var list = [1..10]; 回答1: You can use the List.generate constructor : var list = new List<int>.generate(10, (i) => i + 1); You can alternativelly use a generator: /// the list of positive integers starting from 0 Iterable<int> get positiveIntegers sync* { int i = 0; while (true) yield i++; } void main() { var list = positiveIntegers .skip(1) // don't use 0 .take(10) // take 10 numbers