PatHay
New Member
- Joined
- Feb 9, 2023
- Messages
- 11
- Office Version
- 365
- Platform
- Windows
Hi, for a few years now I have used a lot of VBA to achieve various things in Excel, but it is true to say that my in depth understanding of the code is minimal. Mostly, I have managed to resolve various issues along the way with Googles help and also from this forum which has been totally invaluable.
I have hit an issue now re the code below, which puts the value True into the range of cell(s) required, but then Excel crashes/quits and just shuts itself down. What am I missing in the code please to stop this from happening?
================================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim FndRng As Range
Dim cell As Range
Set FndRng = Range("BA1:BA20")
For Each cell In FndRng
If cell.Value = "True" Then
cell.Offset(0, 3) = cell.Value
End If
Next cell
End Sub
=============================================
Any help here will be very much appreciated. Thank you.
I have hit an issue now re the code below, which puts the value True into the range of cell(s) required, but then Excel crashes/quits and just shuts itself down. What am I missing in the code please to stop this from happening?
================================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim FndRng As Range
Dim cell As Range
Set FndRng = Range("BA1:BA20")
For Each cell In FndRng
If cell.Value = "True" Then
cell.Offset(0, 3) = cell.Value
End If
Next cell
End Sub
=============================================
Any help here will be very much appreciated. Thank you.