'Using ActiveCell.Offset with Private Sub Worksheet_Change(ByVal Target As Range)
I would like to move to the next line by offsetting from ActiveCell, but it either doesn't work or I get run time error. Maybe this isn't possible within Private Sub Worksheet_Change(ByVal Target As Range), but sure would be nicer for users of this free workbook.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Range("C4:C400")
If Not Intersect(Target, rng) Is Nothing Then
ActiveWorkbook.Save
Set selectedCell = Application.ActiveCell
ActiveCell.Offset(1, -4).Select
End If
Dim cng As Range
Set cng = Range("A4:A400")
If Not Intersect(Target, cng) Is Nothing Then
Application.EnableEvents = False
Target.Value = WorksheetFunction.Proper(Target.Value)
Application.EnableEvents = True
End If
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
