برای یکی از کارهام احتیاج دارم که کدی بنویسم شبیه زیر
cells(1,1) = "1234567890"
1234567890
البته اون رنگها برا نمونه است و منظورم دقیقآ همون رنگها نیست
آیا اینکار قابل انجامه یا نه؟؟
|
🖤 پیام تسلیتبا نهایت تأسف و تأثر، باخبر شدیم جناب آقای محمد محمدی با نام کاربری smartman ، از مدیران ارزشمند انجمن اکسل ایران، دار فانی را وداع گفتهاند. ایشان سالها با دانش، تجربه، اخلاق نیکو و روحیه کمک به دیگران، سهم بزرگی در رشد و پویایی انجمن داشتند و خاطره حضور ارزشمندشان همواره در ذهن اعضای انجمن باقی خواهد ماند. مدیریت و اعضای انجمن ExcelIran این ضایعه را به خانواده محترم ایشان، دوستان و تمامی اعضای انجمن تسلیت عرض نموده و از خداوند متعال برای آن مرحوم، رحمت و مغفرت الهی و برای بازماندگان صبر و شکیبایی مسئلت دارند.
انا لله و انا الیه راجعون
|
Sub ColorfullTextString()
Dim Cel_Color01 As String
Dim Cel_Color02 As String
Dim Cel_Color03 As String
Dim Cel_Color04 As String
Dim Cel_Color05 As String
'Color
Cel_Color01 = rgbRed
Cel_Color02 = rgbGreen
Cel_Color03 = rgbBlue
Cel_Color04 = rgbOlive
Cel_Color05 = rgbOrange
ActiveCell.Select
ActiveCell.FormulaR1C1 = InputBox("Please input data")
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Color = Cel_Color01
End With
With ActiveCell.Characters(Start:=4, Length:=3).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Color = Cel_Color02
End With
With ActiveCell.Characters(Start:=9, Length:=3).Font
.Name = "Calibri"
.FontStyle = "Bold Italic"
.Size = 11
.Color = Cel_Color03
End With
With ActiveCell.EntireColumn.AutoFit = True
End With
End Sub
Sub ColorfullTextString()
Dim Cel_Color01 As String
Dim Cel_Color02 As String
Dim Cel_Color03 As String
Dim Cel_Color04 As String
Dim Cel_Color05 As String
'Color
Cel_Color01 = rgbRed
Cel_Color02 = rgbGreen
Cel_Color03 = rgbBlue
Cel_Color04 = rgbOlive
Cel_Color05 = rgbOrange
ActiveCell.Select
ActiveCell.FormulaR1C1 = InputBox("Please input data")
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Color = Cel_Color01
End With
With ActiveCell.Characters(Start:=4, Length:=3).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Color = Cel_Color02
End With
With ActiveCell.Characters(Start:=9, Length:=3).Font
.Name = "Calibri"
.FontStyle = "Bold Italic"
.Size = 11
.Color = Cel_Color03
End With
With ActiveCell.EntireColumn.AutoFit = True
End With
End Sub
a = "123" & chr(13) & "asd" & chr(13) & "kjh" msgbox a
Sub ColorfullTextString()
Dim Cel_Color01 As String
Dim Cel_Color02 As String
Dim Cel_Color03 As String
Dim Cel_Color04 As String
Dim Cel_Color05 As String
'Color
Cel_Color01 = rgbRed
Cel_Color02 = rgbGreen
Cel_Color03 = rgbBlue
Cel_Color04 = rgbOlive
Cel_Color05 = rgbOrange
With Range("A5")
.NumberFormat = "@"
.Value = "1234567890"
.Characters(Start:=1, Length:=3).Font.Color = Cel_Color01
.Characters(Start:=4, Length:=3).Font.Color = Cel_Color02
.Characters(Start:=9, Length:=3).Font.Color = Cel_Color03
End With
End Sub
کامنت