VBA RANGE Property
Private Sub CommandButton1_Click()
'Single cell as range
Sheets("Sheet3").Range("A5").Value = 15
'Multi Cells as Range - more than one cell
Sheets("Sheet3").Range("D14:F25").Value = 25
End Sub
Sub Numbers_print()
Worksheets("Sheet3").Range("A1:C9, D4:F15, G1:M5").Value = 55
End Sub
Sub range_in_brackets()
Range("A15").Select
[b5].Select
Sheets("Sheet2").[c15].Select
[A5:B15].Select
[c5,f10,g15].Select
End Sub
Named Ranges
Sub Rangenames()
End Sub
Short Cut Keys
Private Sub CommandButton1_Click()
'Copy the value in K5 cell and fills upto K10
Worksheets("Sheet1").Range("K5:K10").FillDown
'Copy the value in K5 and fills upto A5
Worksheets("Sheet1").Range("K5:F5").FillLeft
'Copy the value in K5 and fills upto P5
Worksheets("Sheet1").Range("K5:P5").FillRight
'Copy the value in K5 and fills upto K1
Worksheets("Sheet1").Range("K5:K1").FillUp
End Sub
Range . Item
MsgBox Range("A1:A5").Item(2)