brkkrkmz112
New Member
- Joined
- Oct 24, 2016
- Messages
- 43
Hi,
I am trying to automatize the format used for daily updates. I want that when I make revisions, before my comments I want to add a draft such as "*[Date of Today]" and it should be bold.
The problem is that for new updates everything is okay but for the format of previous updates(Being bold) is ruined after this addition. I mean it removes bold formatting.
You can see examples below and my code as well . Thank you in advance.
What it is done. What it should be..
I am trying to automatize the format used for daily updates. I want that when I make revisions, before my comments I want to add a draft such as "*[Date of Today]" and it should be bold.
The problem is that for new updates everything is okay but for the format of previous updates(Being bold) is ruined after this addition. I mean it removes bold formatting.
You can see examples below and my code as well . Thank you in advance.
What it is done. What it should be..
VBA Code:
Option Explicit
Sub burak()
Dim a As Date, b As String, c As String, d As String, k As Integer
Application.CutCopyMode = False
a = Now()
b = Format(a, "dd-mm-yy")
c = CStr(b)
k = Len(Selection(1))
Selection(1).Value = Selection(1).Value & Chr(10) & "*[" & c & "] "
Selection(1).Characters(Start:=k + 2, Length:=11).Font.Bold = True
End Sub