Consulting

Results 1 to 17 of 17

Thread: Excel Macro suddenly starts giving incorrect ActiveCell Data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Jan 2008
    Posts
    411
    Location

    Excel Macro suddenly starts giving incorrect ActiveCell Data

    I've had a macro running for over 3 years, but now it has suddenly started returning the incorrect column Number, even when the cursor is firmly in Column 1.

    It keeps selecting column Y. EVERY TIME !
    It doesn't matter what I select as the ActiveCell.
    Any ideas what could be causing this ?
    If a virus is a possibility, any suggestions as to where I should start looking.

    Here's the code bit that I'm using which is causing the problem.

    I added the MsgBox ActiveCell.Column at the end so that I could see what column it was selecting.

    Sub GetCell()    
        Dim myRow As Long
        Dim val As String    
        val = ActiveCell.Value
        myRow = ActiveCell.Row    
        If ActiveCell.Column <> 1 Then
            MsgBox ActiveCell.Column
            MsgBox " Select a Lot Number "
            Exit Sub
        End If
        MsgBox ActiveCell.Column
    End Sub
    Last edited by Aussiebear; 06-19-2025 at 02:45 AM.

Posting Permissions

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