2016-03-24 18 views

cevap

2

Sen (yılında İtalik yazı) Aşağıdaki örnek VBA kod parçacığını kullanarak elde edebilirsiniz:

Worksheets("Sheet1").Range("A1").Font.Italic = True 

veya set İtalik aşağıdaki gibi/Kalın:

Worksheets("Sheet1").Range("A1").Font.FontStyle = "Bold Italic" 

(re: https://msdn.microsoft.com/en-us/library/office/ff194438.aspx)

aşağıda gösterildiği gibi daha genel durumda, sadece bunun bir parçasına Excel Cell veya metnin tamamına bu tekniği uygulayabilirsiniz:

'demonstrate font Italic/Bold applied to part of Excel cell 
Sub DemoFontItalicBold() 
    Range("A1").Value = "This is Just a Sample Text" 

    'display "A1" 4 initial chars in bold/italic typeface 
    Range("A1").Characters(1, 4).Font.FontStyle = "Bold Italic" 

    'set the word "Sample" in Italic typeface 
    Range("A1").Characters(WorksheetFunction.Find("Sample", Range("A1").Value, 1), Len("Sample")).Font.Italic = True 

    'set the word "Text" in bold typeface 
    Range("A1").Characters(WorksheetFunction.Find("Text", Range("A1").Value, 1), Len("Text")).Font.Bold = True 
End Sub