Here is a way to update a range that is not contiguous using VBA
Sub NonContiguous_Range_Example()
Dim oRng As Range
Set oRng = Range("A1, B5, C9")
oRng.Value = "45"
oRng.Interior.ColorIndex = 34
End Sub
The output will be as shown below:
Welcome to VBA Tips & Tricks. All VBA related information will be posted on this blog. Of late, VBA has been disregarded by many software professionals for .Net, c# and other technologies. This blog will also post articles related to them too Happy reading
Here is a way to update a range that is not contiguous using VBA
Sub NonContiguous_Range_Example()
Dim oRng As Range
Set oRng = Range("A1, B5, C9")
oRng.Value = "45"
oRng.Interior.ColorIndex = 34
End Sub
The output will be as shown below: