BACK

Back to Top

 

 

Rad sa komentarima

Sub Komentar()
If ActiveCell.Comment Is Nothing Then
ActiveCell.AddComment
ActiveCell.Comment.Visible =
False
ActiveCell.Comment.Text Text:="CROExcel.com"
ActiveCell.Comment.Shape.ScaleHeight 0.99, msoFalse, msoScaleFromBottomRight
ActiveCell.Comment.Shape.ScaleWidth 1.88, msoFalse, msoScaleFromBottomRight
ActiveCell.Comment.Shape.AutoShapeType = msoShapeCurvedDownRibbon
End If
MsgBox "Komentar u ćeliji već postoji", , "CROExcel.com"
End Sub

Sub Komentar1()
ActiveCell.ClearComments
ActiveCell.AddComment
ActiveCell.Comment.Visible =
False
ActiveCell.Comment.Text Text:="CROExcel.com"
End Sub

 

 

Makro lista

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then Target.Offset(0, 4) = Date
If Target.Cells = "" Then ActiveCell.Offset(0, 4) = ""
End Sub

Ako u kolonu A unesete podatak onda u kolonu D u istom redu unijet će tekući datum. Ako izbrišete podatak on briše datum.

 

 

Kroz petlju unašanje vrijednosti u sve Textbox-ove u Korisničkoj formi

Private Sub CommandButton1_Click()
Dim Tb As Object
For Each Tb In UserForm1.Controls
If TypeName(Tb) = "TextBox" Then
Tb.Value = 22
End If
Next Tb
End Sub