LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Switch cells on input

I'm using Worksheet_Change for a range d6:l17 . What I am trying to
accomplish is if 1 is entered in F and a 1 is entered in H both contence is
cleared and a 1 is placed on d.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("D6:L17")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
Application.ScreenUpdating = False
With Target
If Range(Cells(.Row, 6)) And Range(Cells(.Row, 8)).Value = 1 Then
Range(Cells(.Row, 6), Cells(.Row, 8)).ClearContents
Range(Cells(.Row, 4)).Value = 1
End If
End With
CleanUp:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

??? Thanks for the help



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I switch the contents of 2 cells? MarL8346 Excel Discussion (Misc queries) 1 June 10th 09 03:07 PM
How to switch two data cells ? Mark246 Excel Discussion (Misc queries) 5 February 25th 08 02:45 AM
Switch calculating cells off Al Excel Discussion (Misc queries) 2 June 8th 07 08:58 AM
How to switch data between cells? Ruger Excel Worksheet Functions 1 August 25th 06 06:43 AM
Is there a way to switch data between two cells? lhassell Excel Discussion (Misc queries) 1 May 26th 06 06:23 PM


All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"