- Public Sub RangeChanged(sender As Object,e As SpreadsheetGear.Windows.Forms.RangeChangedEventArgs)
- '找个单元格定义个别名ZDQY(非数据项),写上需要自动列宽的字段名F_1,F_2
- AW.WorkbookSet.GetLock()
- if Range("ZDQY") IsNot Nothing Then
- Dim QY As String = Range("ZDQY").Cells(0,0).Value.ToString()
- DIM QYS As String() = QY.Split(",")
- for i=1 to QYS.Length
- Dim ZDM As String = QYS(i-1)
- if Range(ZDM) IsNot Nothing Then
- if e.Range.Intersect(Range(ZDM)) IsNot Nothing AndAlso e.Range.IsEntireColumns=false Then
- AW.ActiveWorksheet.ProtectContents = false
- e.Range.EntireColumn.Columns.AutoFit()
- AW.ActiveWorksheet.ProtectContents = True
- End if
- End if
- Next
- End if
- AW.WorkbookSet.ReleaseLock()
- End Sub'单元格编辑完成后执行事件
复制代码
|
|
bj_zm