I have code already in my worksheet.
What is the correct way to add more functions to call?
For example:
I have this code already:
And I would just like to add this code:
Whats the proper way to do so?
What is the correct way to add more functions to call?
For example:
I have this code already:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="WellingtonFrac"
Set rng = Intersect(Target, Range("E8:CZ31, E34:CZ45"))
If Not rng Is Nothing Then Call Capitalise(rng)
Set rng = Intersect(Target, Range("D53:D1583"))
If Not rng Is Nothing Then Call ConvertToTime(rng)
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingColumns:=True, AllowFormattingRows:=False, Password:="WellingtonFrac"
Application.EnableEvents = True
End Sub
And I would just like to add this code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address <> "$A$1" Then Exit Sub
If IsEmpty(Target) Then Exit Sub
Dim strNewText$, strCommentOld$, strCommentNew$
strNewText = .Text
If Not .Comment Is Nothing Then
strCommentOld = .Comment.Text & Chr(10) & Chr(10)
Else
strCommentOld = ""
End If
On Error Resume Next
.Comment.Delete
Err.Clear
.AddComment
.Comment.Visible = False
.Comment.Text Text:=strCommentOld & _
Format(VBA.Now, "MM/DD/YYYY at h:MM AM/PM") & Chr(10) & strNewText
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub
Last edited: