View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
mangesh_yadav[_68_] mangesh_yadav[_68_] is offline
external usenet poster
 
Posts: 1
Default If Cell1 has something Cell2 is blank?

in that case you need a macro something like this

Private Sub Worksheet_Change(ByVal Target As Range)
If (Target.Row = 1) Then ' for row 1
If (Target.Column = 1 And Target.Column <= 6) Then ' fo
columns 1 to 6
If (Target.Value = "x") Then
For i = 1 To 6
If (i < Target.Column And ActiveSheet.Cells(1, i
= "x") Then
ActiveSheet.Cells(1, i) = ""
End If
Next i
End If
End If
End If
End Sub

note that I put a blank incase a new x is entered and there is alread
an x before

- Manges

--
Message posted from http://www.ExcelForum.com