jasgot
New Member
- Joined
- Jul 16, 2002
- Messages
- 30
- Office Version
- 365
- 2019
- 2016
- 2013
- 2010
- Platform
- Windows
I have this little macro that fills in a cell in Column D based on what it sees in Column B. It works great for row 7, How can I make it apply to Row 7 through 29?
Also, this macro really blinks the cursor a lot when it runs, like it is stuck in a loop. How can I stop that?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' Level 1: Set up the event to watch a single cell.
If Target.Address = Range("VB_Trigger").Address Then
ThisFile = Range("F2").Value
ActiveWorkbook.SaveAs Filename:="P:SYO Sales DocsCompleted Time SheetsDon" & "D" & ThisFile
ActiveWorkbook.Windows(1).Caption = ActiveWorkbook.FullName
End If
If Range("B7").Value = "Warranty Parts" Then
Sheet1.Range("D7").Value = "Warranty"
Else:
Sheet1.Range("D7").Value = ""
Range("D7").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="Normal,Fixed,Hold"
End With
End If
End Sub
Also, this macro really blinks the cursor a lot when it runs, like it is stuck in a loop. How can I stop that?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' Level 1: Set up the event to watch a single cell.
If Target.Address = Range("VB_Trigger").Address Then
ThisFile = Range("F2").Value
ActiveWorkbook.SaveAs Filename:="P:SYO Sales DocsCompleted Time SheetsDon" & "D" & ThisFile
ActiveWorkbook.Windows(1).Caption = ActiveWorkbook.FullName
End If
If Range("B7").Value = "Warranty Parts" Then
Sheet1.Range("D7").Value = "Warranty"
Else:
Sheet1.Range("D7").Value = ""
Range("D7").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="Normal,Fixed,Hold"
End With
End If
End Sub