Hi. I have been on this website an almost infinite number of times learning so much from it. Thank you for all you guys have shown so far and for more to come.
I have come across a road block in building my VBA project and I cannot finish off. I know I am so close to it. My code is as follows
------------------------------------------------------------------------------------------Public FoundCell As Excel.Range
Sub Worksheet_BeforeDoubleClick(ByVal target As Range, cancel As Boolean)
Dim sSTR, sSERIALKEY As String
Dim oTEXT As OLEObject
Dim wACT, wTAS As Worksheet
Dim rTEMP As Excel.Range
Dim iCOUNT As Integer
Set wACT = Application.ActiveSheet
On Error Resume Next
Application.EnableEvents = False
sSERIALKEY = ActiveCell.Offset(0, -8).Value
Set wTAS = Sheets("TASKS")
Set FoundCell = wTAS.Range("A:A").Find(What:=sSERIALKEY, LookAt:=xlWhole)
Set oTEXT = wACT.OLEObjects("REMTextBox")
With oTEXT
.Text = ""
.LinkedCell = "$A$50"
.Visible = False
End With
If target.HasFormula = True Then
cancel = True
sSTR = FoundCell.Offset(0, 8).Value
With oTEXT
.Visible = True
.Left = target.Left
.Top = target.Top
.Width = target.Width + 5
.Height = target.Height + 20
.Object.Text = sSTR
.LinkedCell = "$A$50"
End With
oTEXT.Activate
Me.REMTextBox.TextBox
iCOUNT = 0
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal target As Range)
Dim sSTR As String
Dim oTEXT As OLEObject
Dim wACT As Worksheet
Dim iCOUNT As Integer
Set wACT = Application.ActiveSheet
On Error Resume Next
'Application.EnableEvents = False
Application.ScreenUpdating = True
If REMTextBox.Visible = True And iCOUNT = 0 Then
cancel = True
Set oTEXT = wACT.OLEObjects("REMTextBox")
With oTEXT
.Top = 10
.Left = 10
.Width = 0
.Visible = False
End With
FoundCell.Offset(0, 8).Value = Range("$A$50").Value
iCOUNT = iCOUNT + 1
End If
'Application.EnableEvents = True
End Sub
--------------------------------------------------------------------------------------
The target cell has an INDEX-SMALL Formula which pulls through according to some constraints I have inserted. When I double click the target cell, a Textbox appears with the value of the Cell ... I then can edit or change the value of the textbox and then what it is supposed to do is to update the value of the FoundCell.Offset (0.8) cell. I have got to the point where it pulls through the old result but I cant seem to update it.
Please help
Thank you
I have come across a road block in building my VBA project and I cannot finish off. I know I am so close to it. My code is as follows
------------------------------------------------------------------------------------------Public FoundCell As Excel.Range
Sub Worksheet_BeforeDoubleClick(ByVal target As Range, cancel As Boolean)
Dim sSTR, sSERIALKEY As String
Dim oTEXT As OLEObject
Dim wACT, wTAS As Worksheet
Dim rTEMP As Excel.Range
Dim iCOUNT As Integer
Set wACT = Application.ActiveSheet
On Error Resume Next
Application.EnableEvents = False
sSERIALKEY = ActiveCell.Offset(0, -8).Value
Set wTAS = Sheets("TASKS")
Set FoundCell = wTAS.Range("A:A").Find(What:=sSERIALKEY, LookAt:=xlWhole)
Set oTEXT = wACT.OLEObjects("REMTextBox")
With oTEXT
.Text = ""
.LinkedCell = "$A$50"
.Visible = False
End With
If target.HasFormula = True Then
cancel = True
sSTR = FoundCell.Offset(0, 8).Value
With oTEXT
.Visible = True
.Left = target.Left
.Top = target.Top
.Width = target.Width + 5
.Height = target.Height + 20
.Object.Text = sSTR
.LinkedCell = "$A$50"
End With
oTEXT.Activate
Me.REMTextBox.TextBox
iCOUNT = 0
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal target As Range)
Dim sSTR As String
Dim oTEXT As OLEObject
Dim wACT As Worksheet
Dim iCOUNT As Integer
Set wACT = Application.ActiveSheet
On Error Resume Next
'Application.EnableEvents = False
Application.ScreenUpdating = True
If REMTextBox.Visible = True And iCOUNT = 0 Then
cancel = True
Set oTEXT = wACT.OLEObjects("REMTextBox")
With oTEXT
.Top = 10
.Left = 10
.Width = 0
.Visible = False
End With
FoundCell.Offset(0, 8).Value = Range("$A$50").Value
iCOUNT = iCOUNT + 1
End If
'Application.EnableEvents = True
End Sub
--------------------------------------------------------------------------------------
The target cell has an INDEX-SMALL Formula which pulls through according to some constraints I have inserted. When I double click the target cell, a Textbox appears with the value of the Cell ... I then can edit or change the value of the textbox and then what it is supposed to do is to update the value of the FoundCell.Offset (0.8) cell. I have got to the point where it pulls through the old result but I cant seem to update it.
Please help
Thank you