From 81f30303735c0a9cd367a2e624e2444726611fcf Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Tue, 8 Feb 2022 16:19:49 +0300 Subject: [PATCH] Add range.Addvalue extension --- src/AddIn/WorksheetExtensions.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/AddIn/WorksheetExtensions.cs b/src/AddIn/WorksheetExtensions.cs index 51ce13a..cffa55c 100644 --- a/src/AddIn/WorksheetExtensions.cs +++ b/src/AddIn/WorksheetExtensions.cs @@ -27,6 +27,19 @@ namespace RehauSku return cells.All(x => x != null); } + + public static void AddValue(this Range range, double value) + { + if (range.Value2 == null) + { + range.Value2 = value; + } + + else + { + range.Value2 += value; + } + } } }