Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using VBA, I need to create full form crosshairs that will extend to the top
and sides of the form. When the user moves the mouse the crosshairs move with it making it easy to see labels at the bottom and side of the form. I have had no success in doing this. Also the graphic on the form needs to not be disturbed. Thanks for your help, Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean a worksheet based "form" then getting a worksheet to recognize
the Mouse_Move event and to drag crosshairs is very technically challenging and at the same time, from what I recollect, problematic. Instead, if acceptable, I suggest adapting Bob Phillip's post from the following thread. Note also Robert McCurdy's post: http://tinyurl.com/m3gs7 I append my suggested adaption of Bob's post. Assumed is that the form area is within the range "B2:Z30". For the demo, I advise making column widths and row heights equal and giving the range an interior colour, say gray. Note that the highlighting is not affected by selecting multiple cells within the form area or selecting outside of the form area. Paste to the worksheet code module:- Const HLColor As Long = 13434879 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim r As Range, rcol As Range, rrow As Range Set r = Me.Range("B2:Z30") If Intersect(Target, r) Is Nothing Then Exit Sub Set rcol = Intersect(r, Target.EntireColumn) Set rrow = Intersect(r, Target.EntireRow) With Target If .Count 1 Then Exit Sub r.FormatConditions.Delete With rrow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.Color = HLColor End With With rcol .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.Color = HLColor End With .FormatConditions.Delete End With End Sub Regards, Greg "gary" wrote: Using VBA, I need to create full form crosshairs that will extend to the top and sides of the form. When the user moves the mouse the crosshairs move with it making it easy to see labels at the bottom and side of the form. I have had no success in doing this. Also the graphic on the form needs to not be disturbed. Thanks for your help, Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greg,
I do not mean a worksheet based form. I am actually from Excel using VBA to launch an IE browser that will then go to a web site to display a chart. From this browser window, I want the cursor when it is in this window to change to entire window cross hairs so I can accurately read the numbers at the ends of the browser window. My problem is how to turn the mouse cursor into cross hairs that extend to the ends of the browser window and then be able to move the mouse around this window without disturbing the chart on the window. I hope that makes more sense. Thanks for your help, Gary "Greg Wilson" wrote: If you mean a worksheet based "form" then getting a worksheet to recognize the Mouse_Move event and to drag crosshairs is very technically challenging and at the same time, from what I recollect, problematic. Instead, if acceptable, I suggest adapting Bob Phillip's post from the following thread. Note also Robert McCurdy's post: http://tinyurl.com/m3gs7 I append my suggested adaption of Bob's post. Assumed is that the form area is within the range "B2:Z30". For the demo, I advise making column widths and row heights equal and giving the range an interior colour, say gray. Note that the highlighting is not affected by selecting multiple cells within the form area or selecting outside of the form area. Paste to the worksheet code module:- Const HLColor As Long = 13434879 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim r As Range, rcol As Range, rrow As Range Set r = Me.Range("B2:Z30") If Intersect(Target, r) Is Nothing Then Exit Sub Set rcol = Intersect(r, Target.EntireColumn) Set rrow = Intersect(r, Target.EntireRow) With Target If .Count 1 Then Exit Sub r.FormatConditions.Delete With rrow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.Color = HLColor End With With rcol .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.Color = HLColor End With .FormatConditions.Delete End With End Sub Regards, Greg "gary" wrote: Using VBA, I need to create full form crosshairs that will extend to the top and sides of the form. When the user moves the mouse the crosshairs move with it making it easy to see labels at the bottom and side of the form. I have had no success in doing this. Also the graphic on the form needs to not be disturbed. Thanks for your help, Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA to draw lines of SPC | Charts and Charting in Excel | |||
Erase & Draw Border functions no longer work | Excel Discussion (Misc queries) | |||
Draw lines in a userform | Excel Programming | |||
How to draw a object and erase it programmatically | Excel Programming | |||
How do I draw lines..?? | Excel Programming |