View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
filo666 filo666 is offline
external usenet poster
 
Posts: 265
Default Workbook_SheetSelectionChange problem in my add in

Hi Gordon, thanks for your answer;

It did not worked out, when I tried to get the following information:

rw = ActiveWorkbook.ActiveSheet.Cells.Find(What:="*",
After:=ActiveSheet.Range("A1"), Lookat:=xlPart, LookIn:=xlFormulas, _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).Row
rw appear as empty.

any help will be appresiated

"Gord Dibben" wrote:

Place this in your add-in Thisworkbook module

Private WithEvents XLApp As Excel.Application

Private Sub Workbook_Open()
Set XLApp = Excel.Application
End Sub

Private Sub XLApp_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
MsgBox "hello"
End Sub


Gord Dibben MS Excel MVP

On Thu, 22 Jan 2009 06:45:01 -0800, filo666
wrote:

Hi ,

I made an Add In with a Workbook_SheetSelectionChange macro
so that the user of my add in will run the macro when he changes the cell
selection

The problem is that sience the add in work book is not selection-changed,
therefore the macro is not executed; how to tell VB that the macro in the add
in applies to all the open workbooks (Workbook_SheetSelectionChange)?

TIA