I have been running this in VBA, and need to know what the C# equivelant is:
With Intersect(ws.UsedRange, ws.Rows(1).Find("Called On", , , xlWhole).EntireColumn)
.EntireRow.Sort Key1:=.Cells, Order1:=xlDescending, HEADER:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
.NumberFormat = "mm/dd/yy"
End With
I am looking for the text "Called On" in Row 1, and sorting that column DESC then formatting that column in mm/dd/yy format. What would the C# equivelant of this be?
EDIT
This is C# working with data in an Excel Spreadsheet (.xlsx format)
Loading
Sharon WhitePosted Jan 30, 2013, 11:13 PM
//Load File
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"..\..\Sample.xlsx", ExcelVersion.Version2010);
//Find and Highlight
Worksheet sheet = workbook.Worksheets[0];
CellRange range =sheet.Rows[0].FindString("Called On", false, false);
range.Style.Color = Color.Red;
Sort:
workbook.DataSorter.SortColumns.Add(4, OrderBy.Descending);
workbook.DataSorter.Sort(sheet.Range["E1:E12"]);
The solution is based on .NET Excel component.
richard smithPosted Jan 30, 2013, 8:26 PM