ssylvester26
New Member
- Joined
- Aug 12, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I'm trying to come up with a VBA code that will update a cell in column J, based on what value is in column F. But only if the cell in Column J is empty. So far I have this...
Screen Shot Of Excel
My VBA Code so far...
Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
If Not Intersect(Range("F:F"), Target) Is Nothing Then
For Each Rng In Intersect(Range("F:F"), Target)
Select Case Rng.Value
Case "Crating", "Glass Staging", "Logistics", "MFG Support Plant", "PT Support", "RMI", "Support", "Warehouse", "Yard"
Rng.Offset(0, 4).Value = "Indirect Hours"
Case Else
End Select
Next Rng
End If
End Sub
My only issue is that I need to fix the VBA so it doesn't over write the value in Column J if there already is something inputted by the user.
Screen Shot Of Excel
My VBA Code so far...
Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
If Not Intersect(Range("F:F"), Target) Is Nothing Then
For Each Rng In Intersect(Range("F:F"), Target)
Select Case Rng.Value
Case "Crating", "Glass Staging", "Logistics", "MFG Support Plant", "PT Support", "RMI", "Support", "Warehouse", "Yard"
Rng.Offset(0, 4).Value = "Indirect Hours"
Case Else
End Select
Next Rng
End If
End Sub
My only issue is that I need to fix the VBA so it doesn't over write the value in Column J if there already is something inputted by the user.