Private Sub Worksheet_SelectionChange(ByVal Target As Range) '可以直接sub(),不然选择就会触发vba Dim rows_count As Integer Dim rows_id As Integer Dim column_count As Integer Dim column_id As Integer column_count = Selection.Columns.Count '返回选择区域列数
1. '列号转字母(列名) Function Num2Name(ByVal ColumnNum As Long) As String On Error Resume Next Num2Name = "" '超出范围返回空,如调用Num2Name(100000) Num2Name = Replace(Cells(1, ColumnNum).Address(0, 0), "1", "") 'Cell.Address用来返回单元格的地址,参数(0,0)
public void ExportPermissionRoleData(string search, int roleStatus) { var workbook = new HSSFWorkbook(); ); string fileName = HttpUtility.UrlEncode("sheet" + random + ".xls", System.Text.Encoding.UTF8); #region 表头 ISheet worksheet = wo