Results 1 to 13 of 13

Cell changing to ##### after enter?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Cell changing to ##### after enter?

    Hello there,

    I have a worksheet that has the following code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
        ' if changes are made in column B, update column A
        If (Not Intersect(Target, Range("B5:B350")) Is Nothing) Then
            ColumnAChanging = True
            If Target <> "" Then
                Target.Offset(0, -1) = Now
            Else
                Target.Offset(0, -1).ClearContents
            End If
            ColumnAChanging = False
    
        ' if changes made in column A (and not by above change), update column C
        ElseIf (Target.Column = 1 And Not ColumnAChanging) Then
            If (Target <> "") Then
                Target.Offset(0, 2) = Now
            Else
                Target.Offset(0, 2).ClearContents
            End If
                
        End If
    
    End Sub
    
    Private Sub Worksheet_Activate()
        Dim r As Range
        ColumnAChanging = False ' allow changes in column a
    
        On Error Resume Next
        
        With Me
            Set r = .Columns("A").SpecialCells(xlCellTypeBlanks)
            If r Is Nothing Then
                .Cells(.Rows.Count, "a").End(xlUp)(2).Select
            Else
                r(1).Select
            End If
        End With
    End Sub

    So here is what is happening on the work sheet.

    In A3 etc. a number is entered.
    It will then populate the current date in C3
    A date is then manually entered in B3 etc.

    This only works for row 3 & 4

    Once we get to row 5 own ward

    In A5 a number is entered
    The current date populates in C5
    But once you enter in the manual date on C2

    A5 changes to ####### - and when you expand the cell it is time stamping cell for current date and time?

    Any suggestions on how to fix?

    Need more info? Is it something to do with the code above?
    Last edited by SVTF; 11-04-2010 at 03:28 PM.

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