Thread: Name on Tab
View Single Post
  #2   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

In your first sentence you say that you type the entry in C5. In your last
sentence, you say that a VLOOKUP formula put the information in C5. It
can't be both.
You say that Excel does not "see" the C5 entry. What do you mean? What
does Excel do when you type the C5 entry and hit Enter? Is there an error
message? You should also add the following line as the first line of your
macro to handle the situation of the user deleting the contents of C5.
If Target="" Then Exit Sub
HTH Otto
"Mike R" wrote in message
...
I have been using the following code to pull information from a cell to
name
the sheet tab.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C5")) Is Nothing Then ' are we in client
cell name?
If ActiveSheet.Name = Sheet1.Name Then ' in case of grouped sheets
ActiveSheet.Name = Target.Value
End If
End If
End Sub


This code has always worked as long as I type the information into C5, in
this case that is the name of an employee. I built a table with all the
employee information I wanted and used VLOOKUP to place the data in the
relative sheets. Now the code does not "see" the information placed in C5.
I
have tried to change the reference from "C5" to "DataSheet!B3" and that
does
not work either. I have tried to copy and paste / Paste special / pasted
link
and then reference that cell in the code. that does not work either. Is
there anyway to get the information in C5 that has been placed there with
a
VLOOKUP formula to the sheet tab?

Mike R.