Prev: Search Post by user
Next: Count unique
From: Max on 27 Jan 2010 04:10 How can the sub below be modified to a sheet level code that works like the pop-up DV input message (ie when DV cell is selected, the input message will show)? Or any other sub which can give the same functionality - when cell (within a defined range on the sheet) is selected, show the shape "txt1", when cell is deselected, hide the shape? Thanks Sub T_Box1() If ActiveSheet.Shapes("txt1").Visible = False Then ActiveSheet.Shapes("txt1").Visible = True Else ActiveSheet.Shapes("txt1").Visible = False End If End Sub
From: Jacob Skaria on 27 Jan 2010 04:19 Hi Max Try the below..(Sheet event) Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target, Range("A1:B2")) Is Nothing Then ActiveSheet.Shapes("txt1").Visible = True Else ActiveSheet.Shapes("txt1").Visible = False End If End Sub -- Jacob "Max" wrote: > How can the sub below be modified to a sheet level code that works like the > pop-up DV input message (ie when DV cell is selected, the input message will > show)? Or any other sub which can give the same functionality - when cell > (within a defined range on the sheet) is selected, show the shape "txt1", > when cell is deselected, hide the shape? Thanks > > Sub T_Box1() > If ActiveSheet.Shapes("txt1").Visible = False Then > ActiveSheet.Shapes("txt1").Visible = True > Else > ActiveSheet.Shapes("txt1").Visible = False > End If > End Sub
From: Max on 27 Jan 2010 04:34 Thanks, Jacob. I need the shape display to sort-of follow/float next to the cell selected (just like the DV's input message) as the defined range is a long col eg A20:A200, and the shape won't be visible once I select cells further down in that range
From: Jacob Skaria on 27 Jan 2010 05:09 OK Max. Try out the below Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target, Range("A1:H10")) Is Nothing Then Me.Shapes("txt1").Left = Target.Left + Target.Width Me.Shapes("txt1").Top = Target.Top ActiveSheet.Shapes("txt1").Visible = True Else ActiveSheet.Shapes("txt1").Visible = False End If End Sub -- Jacob "Max" wrote: > Thanks, Jacob. I need the shape display to sort-of follow/float next to the > cell selected (just like the DV's input message) as the defined range is a > long col eg A20:A200, and the shape won't be visible once I select cells > further down in that range
From: Max on 27 Jan 2010 05:32
Superb. Many thanks, Jacob. |