samilynn
Board Regular
- Joined
- Jun 24, 2003
- Messages
- 185
- Office Version
- 2016
- Platform
- Windows
I use this code to change assigned codes to employees actual names. However, it runs on the entire sheet. How do I change it to run only on the range that I am selecting before running the macro?
Thank you!
Samantha
Option Explicit
Sub Names()
Dim sht As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
ActiveSheet.Cells.Replace What:="ABC1", Replacement:="NAME1", LookAt:=xlPart, MatchCase:=False
ActiveSheet.Cells.Replace What:="XYZ", Replacement:="NAME2", LookAt:=xlPart, MatchCase:=False
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Thank you!
Samantha
Option Explicit
Sub Names()
Dim sht As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
ActiveSheet.Cells.Replace What:="ABC1", Replacement:="NAME1", LookAt:=xlPart, MatchCase:=False
ActiveSheet.Cells.Replace What:="XYZ", Replacement:="NAME2", LookAt:=xlPart, MatchCase:=False
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub