+ Reply to Thread
Results 1 to 1 of 1

VBA checkRow formula help?

  1. #1
    Registered User
    Join Date
    02-17-2014
    Location
    Somewhere in the world.
    MS-Off Ver
    Excel 2007
    Posts
    1

    VBA checkRow formula help?

    So...I'm totally lost about Excel programming and it'd be kinda awesome if anyone could help explain what these functions mean as well as helping me with the solution...

    So, I have to make a Sudoku (9 by 9, already done) and I'm supposed to check the rows to see if they're all okay (no repeated numbers).
    I'm supposed to use this:
    Function checkRow(row As Integer, col As Integer, leng As Integer) As Boolean

    and check these cells: Cell(row, col), Cell(row, col+1), …, Cell(row, col+leng-1)

    The function should return True if the cells contain all the values 1 through leng and should return False otherwise.
    Add a column at the right hand side of the Sudoku from Question 1 to display “OK” or “Not OK” beside each row. For the correct solution, it should show “OK” beside each row.

    So, problem 1) I have no idea what this function means or what leng is and I have no idea what I need to input in the module so that I can use the function: checkRow.

    I've tried:
    Function checkRow(r As Integer, c As Integer, leng As Integer) As Boolean
    Dim r As Integer, c As Integer
    For Each r In Range("A1:I9").Cells(r, c)
    If cell(r, c) = 1 Then
    checkRow = True
    Else
    checkRow = False
    End If
    End Function

    But, I don't think that's right at all...seeing as my excel worksheet keeps getting an error...
    Last edited by MelN817; 02-19-2014 at 04:43 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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