Need help with applying simple macro to all cells in range

jasgot

New Member
Joined
Jul 16, 2002
Messages
30
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. 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
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
For the cursor blinking a lot just turn the screen updating to false when the macro is running. It will just perform the function without you seeing it.

try this code:
Application.ScreenUpdating = False...

but make sure you turn it on after the macro has been executed.
Application.ScreenUpdating = True
 
Upvote 0
This updating snippet dd not work, I still get an incredible amount of blinking.

Also, I am still looking to find out how to apply the above macro to all the rows in my sheet.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top