QP School

Full Version: Range methods in VBA
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Description:

Ranges represent a cell or group of cells in Excel, and they have methods like Value, Font, and Interior.

Example:

Sub ExampleRangeMethods()
    'Write data to a cell
    Range("A1").Value = "Hello, Excel!"

    'Change font color of cell A1 to red
    Range("A1").Font.Color = RGB(255, 0, 0)

    'Change cell background color to yellow
    Range("A1").Interior.Color = RGB(255, 255, 0)
End Sub