The attached code insert lines specified by user. It gives an compiler error when used on Excel 64 bit. how can I change it to work on 64 bit.
Any help will be appreciated
Code:
Sub InsertLine()
Dim Rng, n As Long, k As Long
Dim r As Long
ActiveSheet.Unprotect "hubert"
Application.ScreenUpdating = True
r = ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row - 1
Rng = InputBox("Enter number of rows required.")
If Rng = "" Then Exit Sub
On Error Resume Next
ActiveSheet.Range(r & ":" & r).Select
Selection.Resize(rowsize:=Rng).EntireRow.Resize(rowsize:=Rng).Insert Shift:=xlUp
Selection.Offset(Rng).AutoFill Selection.Resize(rowsize:=Rng + 1), xlFill
ActiveSheet.Range("A" & r).Select
ActiveSheet.Protect "hubert"
End Sub