breynolds0431
Active Member
- Joined
- Feb 15, 2013
- Messages
- 303
- Office Version
- 365
- 2016
- Platform
- Windows
Hello:
Here is my issue... when data is entered into Range("PymtProviders"), I wanted a macro to convert the first two numbers to a number value in an adjacent column Range("PymtOut"). But for some reason, its not working on the Private Sub Worksheet_Change. It does, however, work as a Public Sub.
Does anybody see an issue with the Worksheet_Change? Thank you for any help in advance.
Here is my issue... when data is entered into Range("PymtProviders"), I wanted a macro to convert the first two numbers to a number value in an adjacent column Range("PymtOut"). But for some reason, its not working on the Private Sub Worksheet_Change. It does, however, work as a Public Sub.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim SourceRange As Range, DestinationRange As Range, i As Integer
Set SourceRange = Sheet3.Range("PymtProviders")
Set DestinationRange = Sheet3.Range("PymtOut")
For i = 1 To SourceRange.Count
DestinationRange(i, 1).Value = Left(SourceRange(i, 1).Value, 2)
Next i
End Sub
Does anybody see an issue with the Worksheet_Change? Thank you for any help in advance.