Hi Gord,
Running the procedure returned the Compile error, "variable not
defined". So I dimmed r as range.
Then it worked fine.
I guess that because use Option Explicit
Dan
On Sep 27, 4:54 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
> Where did you place the code?
>
> It is worksheet event code. Right-click on the sheet tab and "View Code".
>
> Copy/paste into that sheet module.
>
> Gord Dibben MS Excel MVP
>
> On Thu, 27 Sep 2007 23:11:08 -0000, dan dungan <stagerob...@yahoo.com> wrote:
> >I couldn't get this to work at all in Excel 2000 on Windows XP pro.
>
> >Dan
>
> >On Sep 26, 3:10 am, Gary''s Student
> ><GarysStud...@discussions.microsoft.com> wrote:
> >> Try this small worksheet event mcro:
>
> >> Private Sub Worksheet_Change(ByVal Target As Range)
> >> Dim v As Variant
> >> Set r = Range("A1:A3")
> >> If Intersect(Target, r) Is Nothing Then Exit Sub
> >> v = Target.Value
> >> Application.EnableEvents = False
> >> r.Clear
> >> Target.Value = v
> >> Application.EnableEvents = True
> >> End Sub
>
> >> If you enter a value in the range A1 thru A3, the other cells in that range
> >> will be cleared.
> >> --
> >> Gary''s Student - gsnu200747
>
> >> "T.Lindholm" wrote:
> >> > I have three data cells in my table that I need to check for data. If one of
> >> > the three cell has data in it, the other two can not be filled with anything,
> >> > somekind a pop up should be good too. I hope someone understand what I mean,
> >> > and can also help me out.
|