Friday, 31 August 2012

Macro To Select And Set Values To A Range

Macro To Select And Set Values To A Range

Sub MAC()
Range("A1:A10").Select 'Select The Range'
End Sub

'Macro To Set A Value To A Range'
Sub MAC1()
Range("A1:A10") = 10 'Range Value Is Set To 10'
End Sub

'Macro To Set Values To Columns'
Sub MAC2()
Columns(c) = 15 'Column C Value is Set To 15'
Columns("D:E") = 20 'Column D,E Values are Set To  20'
End Sub


'Macro To Set  Values To Rows'
Sub MAC3()
Rows(5) = 25 'Row 5 Value Set To 25'
Rows("5:7") = 30 'Rows 5,7 Values are Set To 30'
End Sub

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts