Explain USED RANGE Method
Write a Program to find USED RANGE in a sheet
USED RANGE First row number in a sheet
USED RANGE Examples
USED RANGE - Columns count through variable
USED RANGE - Select Boarders
Private Sub CommandButton1_Click()
With ActiveSheet.UsedRange
r = Union(.Columns(1), .Rows(1), .Rows(2)).Select
End With
With Selection
.Interior.ColorIndex = 32
.Borders.Weight = xlThick
.Borders.LineStyle = xlDouble
.Font.Bold = True
.HorizontalAlignment = xlCenter
End With
ActiveSheet.UsedRange.Select
Selection.Offset(2, 1).Resize(Selection.Rows.Count - 3, Selection.Columns.Count - 1).Select
With Selection
.Interior.ColorIndex = 28
End With
End Sub
Private Sub CommandButton2_Click()
UsedRange.ClearFormats
End Sub
USED RANGE - First Row
Sub Firstrow_in_Used_Range()
MsgBox ActiveSheet.UsedRange.Row
Cells(ActiveSheet.UsedRange.Row, ActiveSheet.UsedRange.Column).Select
End Sub
USED RANGE Vs Current Region