'公式保存<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'型材部分。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
If e.Range.Intersect(Range("F_5280")) IsNot Nothing Then
Dim cell As IRange
Dim lastRow As Long
Dim destCol As Long
Dim srcCol As Long
Dim i As Long
Dim Cells As IRange = ActiveWorkbook.ActiveWorksheet.Cells
lastRow = Range("F_5245").RowCount + 14
For i = 15 To lastRow
'确定源和目标列
srcCol = 11 'L列
destCol = 6 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = 15 To lastRow
'确定源和目标列
srcCol = 15 'L列
destCol = 7 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = 15 To lastRow
'确定源和目标列
srcCol = 16 'L列
destCol = 8 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
End If
'玻璃公式保存。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
If e.Range.Intersect(Range("F_5280")) IsNot Nothing Then
Dim cell As IRange
Dim lastRow As Long
Dim destCol As Long
Dim srcCol As Long
Dim i As Long
Dim h As Long
Dim Cells As IRange = ActiveWorkbook.ActiveWorksheet.Cells
'确定源和目标列
lastRow = Range("F_5245").RowCount + 28
h = Range("F_5245").RowCount + 17
For i = h To lastRow
srcCol = 15 'L列
destCol = 4 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = h To lastRow
srcCol = 16 'L列
destCol = 5 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = h To lastRow
srcCol = 17 'L列
destCol = 6 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = h To lastRow
srcCol = 18 'L列
destCol = 7 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
End If
' 开启扇///////////////////////////////////////////////////////
If e.Range.Intersect(Range("F_5280")) IsNot Nothing Then
Dim cell As IRange
Dim lastRow As Long
Dim destCol As Long
Dim srcCol As Long
Dim i As Long
Dim h As Long
Dim Cells As IRange = ActiveWorkbook.ActiveWorksheet.Cells
'确定源和目标列
lastRow = Range("F_5245").RowCount + 21
h = Range("F_5245").RowCount + 17
For i = h To lastRow
srcCol = 19 'L列
destCol = 10 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = h To lastRow
srcCol = 20 'L列
destCol = 11 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = h To lastRow
srcCol = 21 'L列
destCol = 13 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
For i = h To lastRow
srcCol = 22 'L列
destCol = 12 'G
If cells(i , destCol) .HasFormula Then
Dim formulaText As String
formulaText =cells(i , destCol) .Formula
' 去除等号
Do While InStr(formulaText, "=") > 0
formulaText = Replace(formulaText, "=", "")
Loop
' 去除空格
formulaText = Trim(formulaText)
' 复制结果到相邻单元格
cells(i , destCol) .Offset(0, srcCol - destCol).Value = formulaText
End If
Next i
End If
|
|
whui520