Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7085509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:26:00+00:00 2026-05-28T07:26:00+00:00

I have an EXCEL VBA function which should return the address of the first

  • 0

I have an EXCEL VBA function which should return the address of the first cell where the cell value is greater zero but it is not working. Does anyone has an idea why?

Code:

Function FindNextFilledCell(RowArray() As Integer, ColArray() As Integer)

For i = UBound(ColArray) To 0
    For j = UBound(RowArray) To 0
        CellValue = cells(RowArray(j), ColArray(i)).Value
        If CellValue > 0 Then
            FindNextFilledCell = cells(RowArray(j), ColArray(i)).Address(False, False)
            Exit Function
        End If
    Next j
Next i

End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:26:00+00:00Added an answer on May 28, 2026 at 7:26 am

    I am still trying to understand what you are trying to do but I suggest the first error is:

    For i = UBound(ColArray) To 0
    

    instead of

    For i = UBound(ColArray) To 0 step -1
    

    This assumes you meant to search the cells in reverse order. If you did not

    For i = 0 to UBound(ColArray)
    

    might be better.

    The next error I have spotted is that you have not defined the type of the value returned by the function. Try:

    FindNextFilledCell(RowArray() As Integer, ColArray() As Integer) As String
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an Excel VBA macro which imports data from a HTML file
I have a UDF non-volatile function in VBA, which requires a global variable (callback
I have an Excel VBA function that takes a number of optional parameters, including
I am porting Excel VBA to VB.NET. I have a function that takes a
I have the same issue as in Excel VBA: Parsed JSON Object Loop but
33266500,332665100,332665200,332665300 was the original value, cell should look like this: 33266500,332665100,332665200,332665300 but what I
I have the following code in VBA (which resides in an Excel 2007 Workbook):
I have a test in Excel VBA: If (test1) And (test2) And (test3) Then
I have trouble comparing 2 double in Excel VBA suppose that I have the
I have writen some code in VBA (Excel) with error handling labels. It worked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.