ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   script detecting the change of active cell (https://www.excelbanter.com/excel-programming/291106-script-detecting-change-active-cell.html)

jack

script detecting the change of active cell
 
Hello,
I am not a user of Excel.
I do programming in vbasic and my code needs some kind of message from
Excel, that the active cell is changed.
Is it possible to have some Excel script detecting that and posting
something to clipboard, for example?
Your thoughts are appreciated.

Please note, that I cannot use Excel events so I cannot use the code as
shown below:

Public WithEvents moExcel As Excel.Application

Private Sub app_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
Excel.Range)
Debug.Print "Selection Changed: " & Sh.Name & ":" & Target.Row & "," &
Target.Column
If Target.Rows.Count 1 Or Target.Columns.Count 1 Then
Debug.Print "multiple cells selected"
End If
End Sub



Vasant Nanavati

script detecting the change of active cell
 
I don't know how you could trap an Excel event without using Excel events.
Am I missing something here?

--

Vasant


"Jack" <replyto@newsgroup wrote in message
...
Hello,
I am not a user of Excel.
I do programming in vbasic and my code needs some kind of message from
Excel, that the active cell is changed.
Is it possible to have some Excel script detecting that and posting
something to clipboard, for example?
Your thoughts are appreciated.

Please note, that I cannot use Excel events so I cannot use the code as
shown below:

Public WithEvents moExcel As Excel.Application

Private Sub app_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
Excel.Range)
Debug.Print "Selection Changed: " & Sh.Name & ":" & Target.Row & "," &
Target.Column
If Target.Rows.Count 1 Or Target.Columns.Count 1 Then
Debug.Print "multiple cells selected"
End If
End Sub






All times are GMT +1. The time now is 12:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com