Thread: VBA Help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default VBA Help

ok, this works, with some minor glitches that i'm still working on.
'============================
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

Dim ws2 As Worksheet
Dim wb As Workbook
Dim NameRange As Range
Dim LastRow As Long
Dim sName As String
Dim rFound As Range

Set wb = ActiveWorkbook
Set ws2 = wb.Worksheets("Sheet2")

Application.EnableEvents = False

LastRow = ws2.Range("a5000").End(xlUp).Row
Set NameRange = ws2.Range("a1:a" & LastRow)

sName = Target.Value

Set rFound = NameRange.Find(What:=sName, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)

If rFound Is Nothing Then
MsgBox "Name " & sName & " not found in Range."
Else
rFound.ClearContents
End If

Application.EnableEvents = True

End Sub
'=====================
now for the glitches = 1. it misses the first name, in cell A1 of
sheet2. for now the work around is to start your name list in A2. :(
2. there's no error handling; give me another 15 minutes & i can fix
that.
3. i'm sure there's a much simpler way of doing it, which somebody
will show you before i can get this posted!
:)
susan



On Oct 19, 8:55*am, Scott Halper wrote:
I'm trying to create a macro to use for setting table assignments at
my wedding. What I'm trying to do is have a box on the left that
contains every single person's name who is invited (on a different
tab). *Then I have colums that represent the different tables and when
I type someone's name in that column I want the person's name in the
large full list to disappear so that the large list only shows people
that are not assigned to a table yet.

Thanks in advance for the help.

Scott