How do i run this macro specifically to a table in a specific sheet? It runs too slow.

VBE313

Well-known Member
Joined
Mar 22, 2019
Messages
686
Office Version
  1. 365
Platform
  1. Windows
Sub AddRowForNew()
Dim rngstart As Range
Dim l As Long, strCells As String
ActiveSheet.Unprotect Password:="B28"
Application.ScreenUpdating = False
Set rngstart = ActiveCell
l = ActiveCell.Row
strCells = "F" & l
Range(strCells).Select
Rows(ActiveCell.Row).Select
Rows(ActiveCell.Row).Offset(1, 0).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.RowHeight = 13.5
Rows(ActiveCell.Row).Offset(1, 0).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Offset(-1, 0).Select
ActiveCell.RowHeight = 5
ActiveCell.Select
ActiveCell.Offset(2, 0).Select
Rows(ActiveCell.Row).Select
Selection.Copy
ActiveCell.Offset(-2, 0).Select
ActiveSheet.paste
ActiveCell.Offset(-1, 0).Select
Rows(ActiveCell.Row).Select
Selection.Copy
ActiveCell.Offset(2, 0).Select
ActiveSheet.paste
Rows(ActiveCell.Row).ClearContents
Rows(ActiveCell.Row).Select
l = ActiveCell.Row
strCells = "F" & l
Range(strCells).Select
Application.Run "NoIndentLevel"
ActiveSheet.Protect Password:="B28"
End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
how many formulas across the rows are being changed ?
 
Upvote 0

Forum statistics

Threads
1,216,519
Messages
6,131,132
Members
449,626
Latest member
Stormythebandit

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