private void SearchRight() { Worksheet activeSheet = Globals.ThisAddIn.Application.ActiveSheet; Range activeCell = Globals.ThisAddIn.Application.ActiveCell; int matchRow = activeCell.Row; int matchColumn = ExcelHlp.FindNext_PopulatedColumn_InRow(activeCell); activeSheet.Cells[matchRow, matchColumn].Select(); }
private void GetRowColInfo() { Range rng = Globals.ThisAddIn.Application.ActiveCell; txtLastRowSpecial.Text = rng.SpecialCells(XlCellType.xlCellTypeLastCell).Row.ToString(); txtLastColSpecial.Text = rng.SpecialCells(XlCellType.xlCellTypeLastCell).Column.ToString(); // TODO (crhodes): Make FindXXXPopulated{Row,Col} take an enum: First, Next,Previous, Last txtFirstRowSearch.Text = ExcelHlp.FindFirst_PopulatedRow_InColumn(rng).ToString(); txtFirstColSearch.Text = ExcelHlp.FindFirst_PopulatedColumn_InRow(rng).ToString(); txtPreviousRowSearch.Text = ExcelHlp.FindPrevious_PopulatedRow_InColumn(rng).ToString(); txtPreviousColSearch.Text = ExcelHlp.FindPrevious_PopulatedColumn_InRow(rng).ToString(); txtNextRowSearch.Text = ExcelHlp.FindNext_PopulatedRow_InColumn(rng).ToString(); txtNextColSearch.Text = ExcelHlp.FindNext_PopulatedColumn_InRow(rng).ToString(); txtLastRowSearch.Text = ExcelHlp.FindLast_PopulatedRow_InColumn(rng).ToString(); txtLastColSearch.Text = ExcelHlp.FindLast_PopulatedColumn_InRow(rng).ToString(); }