Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim a As String
- Dim c As Range
- a = TextBox3.Text
- For Each c In [A1:A1000]
- If c.Value = a Then
- c.Offset(0).Select
- Exit For
- End If
- Next
- If ActiveCell.Text = a Then
- g = ActiveCell.AddressLocal(-1)
- Range(g, "$A$1").Interior.Color = vbWhite
- Range(g, "$A$1").Font.Color = vbBlack
- cat = ActiveCell.AddressLocal
- Range(cat, "$A$1000").Interior.Color = vbBlue
- Range(cat, "$A$1000").Font.Color = vbWhite
- Label3.Caption = WorksheetFunction.Sum(Range(cat, "$A$1000"))
- Else
- MsgBox ("Такого занчения не найдено!")
- End If
- var spreadsheet = SpreadsheetApp.getActive();
- spreadsheet.getRange('A1').activate();
- spreadsheet.getCurrentCell().setFormula('=СЛУЧМЕЖДУ($E$3;$F$3');
- spreadsheet.getActiveRange().autoFill(spreadsheet.getRange('A1:A1000'),
- SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);
- spreadsheet.getRange('A1:A1000').activate();
- Sub FindValue()
- Dim c As Range
- Dim a As Double, bFlag As Boolean
- a = TextBox3.Text
- For Each c In [A1:A1000]
- If c.Value = a Then
- With Range(c, [A1000])
- .Interior.Color = vbBlue: .Font.Color = vbWhite
- End With
- With Range([A1], c)
- .Interior.Color = vbWhite: .Font.Color = vbBlack
- End With
- Label3.Caption = Application.Sum(Range(c, [A1000]))
- bFlag = True: Exit For
- End If
- Next c
- If bFlag = False Then MsgBox "Значение " & a & " не найдено!", 64, ""
- End Sub
Add Comment
Please, Sign In to add comment