I have a two part question on this post please.
1) Solve- explain why the .Range is failing
2) Are any of the debugging options available to me here on such an error? I have looked through all the items in the Watches Window and nothing there seems to present a clue where to look.
I placed this line in the Immediate Window and it returned a false, not sure if it is asking if the interior is red, but my thought was to tell it to change the range of cells to red,
[vba]?activesheet.Range("A1:K20").Interior.Color = vbred
False[/vba]
The error message does offer a subtantial clue, Method 'Range' of Object'_ Worksheet' failed.
However, for the code to see the Range as a Method, (If I am understanding the error message correctly), is throwing me off. It seems to be a valid statement for the Range to be an Object of the Worksheet, wsSource
[vba]
Sub SheetUtilities()
Dim wbSource As Workbook, wsSource As Worksheet
Dim lrwSource As Long
Dim wbn As String
wbn = "TGSProductsAttribPrep.xls"
Set wbSource = Workbooks(wbn)
For Each wsSource In Workbooks(wbn).Worksheets
With wsSource
With .Range("A1:K" & lrwSource)
.Sort Key1:=.Range("B2"), Order1:=xlAscending, Key2:=.Range("C2") _
, Order2:=xlAscending, Key3:=.Range("A2"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
End With
.Range("A2:J" & lrwSource).ClearFormats
End With
Next wsSource
End Sub
[/vba]
thanks....