MarcianoPL
New Member
- Joined
- Sep 23, 2020
- Messages
- 6
- Office Version
- 2016
- Platform
- Windows
Dear Sirs,
I'm having diffculties to modify makro below. I was hoping that you will be able to aid me.
First issue is that it only works for one cell, i wanted it to work for entire row CV with values recorded in entire row CW.
Second issue, how to reset xCount value? During testing this counter goes far far away, i need to reset this before file handover.
I'm having diffculties to modify makro below. I was hoping that you will be able to aid me.
First issue is that it only works for one cell, i wanted it to work for entire row CV with values recorded in entire row CW.
Second issue, how to reset xCount value? During testing this counter goes far far away, i need to reset this before file handover.
VBA Code:
Dim xVal As String
'Update by Extendoffice 2018/8/22
Private Sub Worksheet_Change(ByVal Target As Range)
Static xCount As Integer
Application.EnableEvents = False
If Target.Address = Range("CV8").Address Then
Range("CW8").Offset(0, xCount).Value = xVal
xCount = xCount + 1
Else
If xVal <> Range("CV8").Value Then
Range("CW8").Offset(0, xCount).Value = xVal
xCount = xCount + 1
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
xVal = Range("CV8").Value
End Sub