Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to write code in vba? For example, if the cell in column A has more than 60 words, it will be automatically reduced to font size 8.
How to write code in vba? For example, if the cell in column A has more than 60 words, it will be automatically reduced to font size 8.
Sub? Test ()

Dim? Me? As? integer

For what? Me? =? 1? Where to? The last row of column a

What if? Len (cell (I, 1). value)? & gt? 60? then

Cells (me,? 1)font . size? =? eight

End? if

then

For what? Me? =? 1? Where to? The last row of column b

What if? Len (cell (I, 2). value)? & gt? 25? then

Cells (me,? Font.Size? =? 10

End? if

then

End? submarine