I finally found the solution and why a color line of code would rise a 'size' error. Set com = Comment_Format(Range("a1"), Range("b1")) FontStyle = Rg_Value.Characters(i, 1).Font.FontStyle 'a = Rg_Value.Characters(i, 1).Font.Color Size = Rg_Value.Characters(i, 1).Font.Size If Rg_Com.Comment Is Nothing Then Rg_Com.AddComment Which is strange, because size works, and if I comment out color lines (') it works.įunction Comment_Format(ByVal Rg_Value As Range, ByVal Rg_Com As Range) As Comment My piece of code works, except for color, which throws a Run-Time error '1004':įont size must be between 1 and 409 points. I need to copy a cell in Excel from one range to another range's comment, while keeping its format (size, bold, color, italic.).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |