View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Assign ChangeEventMacro to unknown SheetName

Another approach might be to copy a 'template' sheet with code from your
Main wb (could be an addin) into the current wb.

I take it "FindBC" already exists in all workbooks which suggests those wb's
themselves were derived from a particular template. If so they could contain
an additional hidden dummy template sheet to be copied into same wb. But I'm
stretching into the realm of second guessing!

Regards,
Peter T

"CLR" wrote in message
...
Thanks for the response Peter, but I think I have bitten off more than I

can
chew here........I will probably opt fot Dave's "template" solution, even

tho
it will be a lot of work, it fits my mini-mind.

To clarify what I'm trying to do tho....I want to import a sheet into my
Main workbook and then write this code to that sheet...

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$10" Then
Call FindBC
Else
End If
End Sub


What "FindBC" does, is actually Autofilter the data for whatever value is
entered into B10.........it works good in other workbooks where the sheet

is
permanent, and I can hardcode.....just having trouble here where the sheet

is
imported.

Vaya con Dios,
Chuck, CABGx3



"Peter T" wrote:

Dave has probably already interpreted your question correctly and

answered
it (when I first read it I had a different take). If you are looking to

trap
"UserSheetName" events (or even the events of any number of sheets in

other
workbooks) directly in your own Main project shout again.

Regards,
Peter T

"CLR" wrote in message
...
Hi All............

I am making a small program in which I open a second Excel workbook

and
extract a sheet from it into my Main workbook. I do not know the name

of
the
sheet, and assign it "UserSheetName" variable, and then I can populate

and
manipulate data on that sheet at will.....and close te second
workbook......that part all works fine.

What I would like to do now, is from a macro in my Main workbook, I

would
like to create a ChangeEvent macro into to that "UserSheetName" sheet

that
is
now located also in my Main workbook.

Is this a doable thing?

Vaya con Dios,
Chuck, CABGx3