How to set characters font in excel by m-file?
Mostra commenti meno recenti
Hi all
In VBA, for one cell, I can use 'ActiveCell.Characters(Start:=2, Length:=2).Font.Color = -16776961' to set 2nd and 3rd Characters font color to red.

Now, I want to do the same thing by m-file. But code like this
Worksheet.Range('A1').Characters('Start:=2, Length:=2').Font.ColorIndex = 3; %red
told me index overflow, I guess 'Start:=2, Length:=2' is wrong way to do this. What should I do? Thanks.
5 Commenti
Walter Roberson
il 13 Lug 2022
I suggest experimenting with
Worksheet.Range('A1').Characters(2, 2).Font.ColorIndex = 3; %red
Steven Lord
il 18 Lug 2022
Can you show us the code you used to create the variable named Worksheet?
kei hin
il 6 Set 2023
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spreadsheets in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!