Hi All,
I'm trying to password protect a macro buttom but not sure of how to do it based on the code I've been using for the macro?
Help very much appreciated!
Option Explicit
Sub MoveDatatolong()
Dim LR As Long, LR2 As Long
Application.ScreenUpdating = False
With Sheets("Long")
LR2 = .Range("H" & Rows.Count).End(xlUp).Row
If LR2 > 2 Then
.Range("A3:I" & LR2).ClearContents
End If
End With
With Sheets("Pipeline Input")
LR = .Cells(Rows.Count, 8).End(xlUp).Row
LR2 = Sheets("Long").Range("H" & Rows.Count).End(xlUp).Row
With .Range("H2:H" & LR)
.AutoFilter Field:=1, Criteria1:="Move to long"
.Offset(1).Resize(LR).EntireRow.Copy Sheets("Long").Range("A" & LR2 + 1)
.Offset(1).Resize(LR).EntireRow.Delete
.AutoFilter
End With
End With
Application.ScreenUpdating = True
End Sub
Gavin
Bookmarks