Consulting

Results 1 to 3 of 3

Thread: Clearing contetn of cells

  1. #1

    Clearing contetn of cells

    Hi,

    can you help me please with clearing content of cells. I have range of cells from A1 - B1 - C1 - D1. When I put "x" some formulas is calculate. Next when put "x" in B1
    A1-C1-D1 needs to be clear, and same in other possibilities.

    Tnx in advice.

  2. #2
    anybody

  3. #3
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location
    1) what formula are you are running?
    2) where is the data that gets manipulated?
    3) do you only put an "X" in one of these 4 cells at a time?

    We can make a SheetChange code fire when an "X" is in the target cells, and clear the other cells if that is what you are looking to do?

    Private Sub Worksheet_Change(ByVal Target As Range)
            
        If Target.Cells.Count > 1 Then Exit Sub
        If Target.Row = 1 Then
            With Target
                If .Column = 1 Then
                    ' code if A1 is selected
                If .Column = 2 Then
                    ' code if B1 is selected
                If .Column = 3 Then
                    ' code if C1 is selected
                If .Column = 4 Then
                    ' code if D1 is selected
                End If
            End With
        End If
    End Sub

Posting Permissions

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