I think its kind of like trying to select a cell in a hidden sheet, just applyed to comments I did like you, first color it all and then a second loop,īut added the autosize before the first loop (because my text is BIG), then color loop,Īnd then doing a second autosize=true because of course size changed ! 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |