+ Reply to Thread
Results 1 to 2 of 2

What is this VBA code doing?

  1. #1
    Registered User
    Join Date
    03-08-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    28

    What is this VBA code doing?

    Hi, I am running an internal report in Excel and got an error 13: type mismatch. The debug goes to this part of the code

    Please Login or Register  to view this content.
    I'm unfamiliar with VBA but have a pretty good grasp of C#, C++ and stuff. I'm just wondering what this piece of code actually is doing? Things such as the Do While (Range("AY" & R) = C as well as arr_div(C) are over my head ...

    Thanks.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: What is this VBA code doing?

    The code is looping through cells in column AY starting at cell AY6.

    Do While Range("AY" & R) = C

    ...where R is the row number in column AY. It's comparing if each cell value in column AY equals 1,2,3 ...up to 6

    I don't see anything wrong with the code syntax.

    One possible cause of your code error could be if a cell on your worksheet within column AY has an error value as a result of a formula e.g #N/A

+ Reply to Thread

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