Results 1 to 7 of 7

Run time error 13, type mismatch Error

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Run time error 13, type mismatch Error

    I Recv this macro
    Sub STEP9()
    Dim fPath As String, wb As Workbook, r As Range
    fPath = ThisWorkbook.path
    Set wb = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Files\PL.xlsx")
        With wb.Sheets(1)
            For Each r In .Range("B2", .Cells(Rows.Count, 2).End(xlUp))
                If r.Value > 0 Then
                    .Range(r, .Cells(r.Row, Columns.Count)).ClearContents
                End If
            Next
        End With
        wb.Close True
    End Sub
    I changed this macro as per my needs
    Sub STEP9()
    Dim fPath As String, wb As Workbook, r As Range, Ws1 As Worksheets
    fPath = ThisWorkbook.path
    Set wb = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Files\PL.xlsx")
    Set Ws1 = wb.Worksheets.Item(1)
        With Ws1
            For Each r In .Range("B2", .Cells(Rows.Count, 2).End(xlUp))
                If r.Value > 0 Then
                    .Range(r, .Cells(r.Row, Columns.Count)).ClearContents
                End If
            Next
        End With
        wb.Close True
    End Sub
    & i got error
    Run time error 13, type mismatch Error
    & Highlighted line is
    Set Ws1 = wb.Worksheets.Item(1)
    Last edited by Zaeguzah; 08-23-2020 at 07:13 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Getting error message- Run-time error '13'; type mismatch
    By UPA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-22-2017, 03:43 AM
  2. [SOLVED] run time error 13. type mismatch error
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2017, 10:21 AM
  3. Run-time error 13: Type Mismatch error
    By mxlew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2015, 10:06 AM
  4. [SOLVED] run-time error '13' Type Mismatch error
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2014, 03:05 PM
  5. Run time error 13 Type mismatch error
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-24-2014, 08:17 AM
  6. [SOLVED] run-time error '13' Type Mismatch error
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-16-2012, 08:59 AM
  7. Conditional Formatting - Run Time Error '13' Type Mismatch Error
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2011, 07:37 PM

Tags for this Thread

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