Thread: Runtime Error
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
bpeltzer bpeltzer is offline
external usenet poster
 
Posts: 180
Default Runtime Error

What's in cell C1? I also get a type mismatch if I've got #N/A in C1, for
instance. If it's blank or alphanumeric, this seems okay.

"CurtH" wrote:

I'm getting a runtime error '13':
Type Mismatch

The code is:

Function UsageLog_1()

' Stores who and when on Sheet1, column C
Sheets("UsageLog").Select

If Range("C5600").End(xlUp).Row = 1 And Range("C5600").End(xlUp).Value =
"" Then <===== This is the line which is highlighted for the error
Range("C5600").End(xlUp).Value = "Last opened by " &
Environ("username") & " at " & Now
Exit Function
End If

Range("C5600").End(xlUp).Offset(1, 0).Value = "Last opened by " &
Environ("username") & " at " & Now

ThisWorkbook.Sheets("COVER").Activate
End Function

Thanks in advance