Results 1 to 19 of 19

Incompatible Data Types

Threaded View

  1. #1
    Registered User
    Join Date
    06-10-2009
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    46

    Incompatible Data Types

    Hi,

    I have a problem concerning datatypes for an if-loop, the failure message tells me "Datatypes incompatible" for this code-line:

    If CLng(.Worksheets("Database").Cells("R" & last)) >= CW Then
    Here is also the full context:

    CW = CLng(InputBox("Please enter the current week (1-53)", Week))
    With ActiveWorkbook
    last = .Worksheets("Database").Cells(Rows.Count, 18).End(xlUp).Row
    i = 0
        For u = 7 To last
            
            If CLng(.Worksheets("Database").Cells("R" & last)) >= CW Then
                .Worksheets("Database").Rows("last").Copy Destination:=.Worksheets(1).Rows("3+i")
            End If
        Next u
        End With
    Thanks in advance for your help!
    Last edited by RoyMakaay1985; 09-09-2009 at 09:53 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1