Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Convert Excel Range To Absolute Excel Range
// excel address to absolute address conversion // supply a sheet name and a range, and outputs an absolute range using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine(ConvertToFullAddress("Report","A1:B2")); } static string[] SplitCellAddr(string celladdr) { string letters=""; string nums=""; int mode=0; for(int k=0; k<celladdr.Length; k++) { if(Char.IsDigit(celladdr[k])) { nums+=celladdr[k]; } else if(Char.IsLetter(celladdr[k])) { letters+=celladdr[k]; } } return new string[] { letters, nums }; } public static string ConvertToFullAddress(string sheetname, string inputaddr) { string[] pair=inputaddr.Split(':'); string[] firstcell = SplitCellAddr(pair[0]); string[] secondcell = SplitCellAddr(pair[1]); return "'"+sheetname+"'!$"+firstcell[0]+"$"+firstcell[1]+":$"+secondcell[0]+"$"+secondcell[1]; } } }
run
|
edit
|
history
|
help
0
code
Test
ParseIpRanges invalid character in string
Test Stopwatch
UriParts
różne wersje parsowania kwoty i daty (CultureInfo)
test
asxasxd
Prime number
asxsd