This code works well in Excel 2003 but fails in Excel 2007. What am I not seeing in it that crashes it? It errors out when it gets to the "LastRow =".. This is my error message: Run-Time Error 13 Type Mismatch
Dim LastRow As Long
Dim LastColumn As Integer
Dim LastCell As Range, NextCell As Range
' ****************************************************
' Finds LastRow and LastColumn
With Worksheets("DB")
' Find Last Row/Col
If WorksheetFunction.CountA(Cells) > 0 Then
' Search for any entry, by searching backwards by rows
LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
' Search for any entry, by searching backwards by columns
LastColumn = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
End If
Set NextCell = Worksheets("DB").Cells(LastRow + 1, (LastColumn))
End With
' ****************************************************
Found an error. Guess I copied the Lastrow and was GOING to change the second one to columns. but that still doesn't solve the hang on the first chunk. Opps while editing that last part to columns I see that I may have typed an extra "s" in the .Rows Looks like it SHOULD be .Row I'll see when I get home since my hard copy at work shows no "s". Guess that's what I get when trying to "Remember" the code when I get home. To "s" or not to "s", that is the question. LOL At least I think I solved it with a little poke the the head. Thanks Siddharth.