Hi Ken Puls,
Thank You so much thats is what I'm excatly I'm looking for. I tried to loop through the worksheets it only works on the current worksheet that I run the macro on. Any Ideas how to get this to work through all the worksheets?
Sub test()
Dim rngSel As Range
Dim objSheet As Worksheet
For Each objSheet In ActiveWorkbook.Worksheets
Set rngSel = IncreaseUsedRange(ActiveSheet)
rngSel.Select
Next objSheet
End Sub
Public Function IncreaseUsedRange(ws As Worksheet) As Range
'Function Purpose: Returns range from cell A1 to the last used cell
' and then increases the range by one row and one column
Dim FirstRow As Long
Dim LastRow As Long
Dim FirstColumn As Integer
Dim LastColumn As Integer
On Error Resume Next
With ws
LastRow = .Cells.Find(What:="*", After:=.Cells(1, 1), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LastColumn = .Cells.Find(What:="*", After:=.Cells(1, 1), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Set IncreaseUsedRange = Range(.Cells(1, 1), .Cells(LastRow + 1, LastColumn + 1))
End With
On Error GoTo 0
End Function