+ Reply to Thread
Results 1 to 3 of 3

type missmatch error on if statement

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    type missmatch error on if statement

    I wish to copy a row if a cell in column W is either greater than 5 or less than -5 but I get the below missmatch error. Any ideas why

    drowM = 2
    drowE = 2
    With Worksheets("INPUT")
      LR = .Cells(.Rows.Count, "A").End(xlUp).Row
      For r = 2 To LR
        mand = .Range("W" & r)
        If (mand > 5 Or mand < -5) Then
          .Rows(r).Copy Worksheets("CASH OUTLIERS").Cells(drowM, 1) '
          drowM = drowM + 1
        End If
      Next
    End With

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: type missmatch error on if statement

    The cell contains an error or text.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: type missmatch error on if statement

    OK

    Also if the cell is blank it will copy the row row accross but I only want values that are plus 5 or minus 5

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Runtime Error 13 Type missmatch
    By jonastjader in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2014, 11:45 PM
  2. [SOLVED] select case type missmatch???
    By RoOmIE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-15-2013, 02:20 PM
  3. Error 13 - missmatch
    By colin.dickson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 08:11 AM
  4. vba array type missmatch
    By Jollyfrog in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-10-2010, 10:33 AM
  5. type missmatch on Selection.Offset
    By webby2006 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2006, 10:44 AM

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