Pulling old result and updating it directly

Kilanim

New Member
Joined
Apr 16, 2015
Messages
1
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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top