+ Reply to Thread
Results 1 to 6 of 6

Error 13: updating an adjacent cell if cell is not empty

  1. #1
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Error 13: updating an adjacent cell if cell is not empty

    Hello,

    I'm trying to execute the VBA code below but I get a run-time error 13 Type Mismatch with a highlight on If cell.Value <> "" Then.

    I cannot manage to figure out what is missing or incorrect here. Would someone help or point me to the right direction to solve this please?

    Thank you.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Error 13: updating an adjacent cell if cell is not empty

    Can't replicate the issue - maybe share a sample workbook?

    If you think that it's the If cell.Value <> "" Then line that's causing the issue, try replacing with If Not IsEmpty(cell) Then
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  3. #3
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Error 13: updating an adjacent cell if cell is not empty

    ah, could be that you've declared 'cell' without a type. Best practice is to use a term that isn't likely to be misinterpreted, e.g. 'MyCell'

    Then try Dim MyCell as Range etc....

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Error 13: updating an adjacent cell if cell is not empty

    Hello. Try with:

    PHP Code: 
    Sub Update_Remit_Column()
    Application.EnableEvents False
    With Sheets
    ("Sales")
      .
    Range("V2:V5000") = .Evaluate("IF(AG2:AG5000<>"""", ""Yes"", V2:V5000)")
    End With
    Application
    .EnableEvents True
    End Sub 
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  5. #5
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Error 13: updating an adjacent cell if cell is not empty

    Thank you very much for your contribution. They helped me learned more things about coding. beyond Excel's suggestion resolved my issue and made it even easier. Thank you.

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Error 13: updating an adjacent cell if cell is not empty

    Quote Originally Posted by rakotonirinas View Post
    Beyond Excel's suggestion resolved my issue and made it even easier. Thank you.
    That's good!...I'm glad it's like that and thanks for the +Rep.

+ 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. [SOLVED] Problem with counting item in adjacent cell if the cell in a particular column is empty
    By stlee96 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-22-2021, 06:43 AM
  2. [SOLVED] IF formula to have a cell go to blank if adjacent cell is empty
    By BryanHCR in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-14-2019, 10:14 AM
  3. [SOLVED] Run Code if Adjacent Cell is not empty
    By bhenlee in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-08-2018, 01:42 PM
  4. [SOLVED] Automatically lookup and set an empty cell's value if adjacent cell is typed & vice versa
    By RedSummer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-22-2015, 12:16 PM
  5. Copy Cell data if adjacent cell is empty
    By rflorentino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2014, 02:34 PM
  6. Help to move value into first empty cell and adjacent cell please
    By susmahaffy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-01-2014, 02:11 PM
  7. Replies: 1
    Last Post: 02-06-2008, 08:23 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