Results 1 to 3 of 3

Thread: [RESOLVED] Parts of macro made in 2007 not working in 2010

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    3

    Resolved [RESOLVED] Parts of macro made in 2007 not working in 2010

    Hello all,

    I'm attempting to use a macro in Excel 2010 that a coworker made using Excel 2007. The majority of the macro works fine, excel for one section:

    Private Function IsCheckedOut() As String
    Sheet1.Range("H5").Select
    Do While ActiveCell.Value <> ""
    ActiveCell.Offset(1, 0).Select
    If ActiveCell.Value = ScanNumber.Value Then
    MsgBox "Found Scan Number"
    If ActiveCell.Offset(0, 2).Value = "" Then
    MsgBox "Not Checked Out"
    IsCheckedOut = "Yes"
    Exit Function
    End If
    End If
    MsgBox "Looping to Next Row"
    Loop
    IsCheckedOut = "No"
    End Function

    I've added some message boxes to see where it gets, and in a situation where it should be setting "IsCheckedOut" to "Yes" it is not getting past the first "If" statement, I'm only seeing the "Looping to Next Row" box.

    Any ideas why this is not working in 2010? All my googling has not yielded anything informative.

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    3

    Re: Parts of macro made in 2007 not working in 2010

    It appears to be something other than just 2007 vs 2010 because some people are hitting this problem while running it in 2007 also. I can't figure out why it's not working.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    3

    Re: Parts of macro made in 2007 not working in 2010

    Turns out the code is not working for number only values, but throw some text in there and it works fine. Figured it out myself!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width