View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default form follows user's activity on sheet and updates itself

with the form modeless, you can navigate around the workbook
in the dorm, you can declare public subs that you can interface with from
other VBA code and these subs (procedures) can populate the viewer

so lets say in the form you have
Sub SheetChanged(sh as worksheet)
SelectionChanged sh.Selection
End Sub
Sub SelectionChanged(target as range)
'some code here
End Sub

now in the code page for ThisWorkbook you can trap sheet change and pass it
to the form.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
frmViewer.SheetChaneg sh
End Sub

you can do a similar thing with selection changes, but using ThisWorkbook's
event and not the individual sheets' events

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
With frmViewer
.SheetChanged sh
.SelectionChanged Target
End With
End Sub


"okey" wrote in message
...
(repost - I think this one belongs here)

I have a huge ss and need to work with all of it. There are certain
cells in each long row that I'd like to see at all times.

I have a "viewer" connected to a hot keyed macro that does just that.
The form also allows editing of those cells.

Is is possible that the form can be made to follow me while I work on
the ss? If I move to row X, the form senses that and gets the data
from that row. I could install some goto controls on the form, but I
rather the form follow my activities while I work on the ss.

And I want the form. It has tools that help display and edit complex
strings. Just moving the cells to a central area on the ss is not
what I want..

Thank you.