+ Reply to Thread
Results 1 to 13 of 13

Excel Debugging Issue

  1. #1
    Registered User
    Join Date
    06-27-2016
    Location
    America
    MS-Off Ver
    2011
    Posts
    5

    Excel Debugging Issue

    Hi Here is my code. It's my first day using excel's VBA tool, and I'm getting a mismatch error on the bolded line. Here is my data set.
    Screen Shot 2016-06-27 at 1.06.55 PM.png

    Please Login or Register  to view this content.
    Last edited by Vinkebot; 06-27-2016 at 04:08 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Excel Debugging Issue

    Please use code tags with your code as per forum's rule.
    There is no cell zero
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-27-2016
    Location
    America
    MS-Off Ver
    2011
    Posts
    5

    Re: Excel Debugging Issue

    I think I fixed the old problem. Could anyone help me with the new code.

    The Goal: I'm basically trying to get an average value (from the 2s and 3s in the middle column) for each of the ones that appear in the one to the left. I want the values to show up in the empty column on the right.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Excel Debugging Issue

    Please attach a sample book, showing your desired result. I dread though, you are on Mac.

  5. #5
    Registered User
    Join Date
    06-27-2016
    Location
    America
    MS-Off Ver
    2011
    Posts
    5

    Re: Excel Debugging Issue


  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Excel Debugging Issue

    Please Login or Register  to view this content.
    Different from space?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Registered User
    Join Date
    06-27-2016
    Location
    America
    MS-Off Ver
    2011
    Posts
    5

    Re: Excel Debugging Issue

    Hm what do you mean by that. I was basically trying to use this line to write the condition (as long as the cell is not empty).

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Excel Debugging Issue

    Please Login or Register  to view this content.
    Look for the difference.

  9. #9
    Registered User
    Join Date
    06-27-2016
    Location
    America
    MS-Off Ver
    2011
    Posts
    5

    Re: Excel Debugging Issue

    Oh ok. I still get the type mismatch error after that change.

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Excel Debugging Issue

    2.66666667 is not an integer

    Please Login or Register  to view this content.
    try long instead?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  11. #11
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,615

    Re: Excel Debugging Issue

    deleted by bvj
    Last edited by protonLeah; 06-28-2016 at 06:10 PM.
    Ben Van Johnson

  12. #12
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel Debugging Issue

    Quote Originally Posted by protonLeah View Post
    Your code is declaring Count and j, 3741 times each.
    Hi,

    That is not actually the case. As long as you don't try and use a variable in a line that precedes its declaration, it's really just a matter of preference where the declaration is. Even inside a loop the compiler will only declare it and allocate memory once.

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Excel Debugging Issue

    Based on your image in post#5
    Please Login or Register  to view this content.

+ 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] Debugging issue
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-23-2015, 06:21 PM
  2. [SOLVED] Debugging issue-Run time error 1004. What does this mean?
    By kevwilsondj in forum Excel General
    Replies: 5
    Last Post: 04-26-2015, 06:52 PM
  3. [SOLVED] Inconsistent scoping of Named Ranges - Debugging Issue
    By Romulo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2013, 02:47 AM
  4. Debugging and Loop issue
    By harshjog123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2012, 07:58 PM
  5. Debugging issue with VBA
    By betrayedslinky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 11:37 AM
  6. Debugging issue with Step Into
    By Khaos176 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-31-2009, 11:22 AM
  7. [SOLVED] Excel VBA debugging help needed!
    By mainemike in forum Excel General
    Replies: 4
    Last Post: 02-22-2006, 08:45 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