Z
Z
ZUeVMD2021-01-20 17:25:39
Visual Basic
ZUeVMD, 2021-01-20 17:25:39

How to change font using VBA?

There is a code, but I don’t understand how to change the font to Times New Roman in the headers and footers

Application.PrintCommunication = False
    
    With ActiveSheet.PageSetup
    
        .RightHeader = _
            "КФД 4235445 n. &P" & Chr(10) & _
            "Номер ЛС " & Range("XDO_?XDOFIELD62?").Value & Chr(10) & _
            "Дата " & Range("XDO_?XDOFIELD58?").Value & " " & Range("XDO_?XDOFIELD57?").Value & " 20" & Range("XDO_?XDOFIELD59?").Value
            
        .RightFooter = _
            "Номер страницы &P" & Chr(10) & _
            "Всего страниц &N"
        
    End With
    
    Application.PrintCommunication = True

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Babkin, 2021-01-22
@shtile

.RightFooter= "&""ИМЯ_ШРИФТА,обычный""Ваш текст"
Works for me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question