Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ginti()
- Dim Source As Range
- Set Source = Selection
- q = Source.Text
- 'Source.Value = 3
- 'Source.Value = 4
- With Source
- .Value = 1
- .AutoFill .Resize(q, 1), xlFillSeries
- End With
- End Sub
- Sub mdInsulationCheck()
- Dim Source As Range
- ' Dim iCol As Long
- Dim nCol As Long
- Dim iRow As Long
- Dim nRow As Long
- Dim total As Double
- Set Source = Selection
- nCol = Source.Columns.Count
- nRow = Source.Rows.Count
- For iRow = 1 To nRow
- x = Source.Rows(iRow).Columns(1).Address
- x2 = Source.Rows(iRow).Columns(nCol).Address
- sumx = Source.Rows(iRow).Columns(1 - 4).Address
- sumx2 = Source.Rows(iRow).Columns(0).Address
- Range(sumx & ":" & sumx2).Select
- tempSum = WorksheetFunction.Product(Selection)
- For tempcol = 1 To nCol
- If (Source.Rows(iRow).Columns(tempcol).Value = tempSum Or Source.Rows(iRow).Columns(tempcol).Value = "") Then
- Else
- Range(Source.Rows(iRow).Columns(tempcol).Address).Select
- Selection.Interior.Color = RGB(255, 100, 100)
- MsgBox "ERROR in " & Source.Rows(iRow).Columns(tempcol).Address
- Exit Sub
- End If
- Next tempcol
- Next iRow
- MsgBox "Calculation is OK"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement