Little_Ghost
New Member
- Joined
- Dec 13, 2010
- Messages
- 48
Hi Guys,
I have this VBA code which I thought was working, but it isn't. At least, not completely.
I've spend hours trying to figure out what is wrong but I can't figure it out.
Maybe someone here can find it?
This is the code:
It seems to neglect the column value: when I'm in F11 I can add a row, which I shouldn't be able to.
I hope someone can help me.
Kind regards,
Little Ghost
I have this VBA code which I thought was working, but it isn't. At least, not completely.
I've spend hours trying to figure out what is wrong but I can't figure it out.
Maybe someone here can find it?
This is the code:
Code:
Sub InsertRowAndCopyFormulas()
Dim dest As Range
Application.ScreenUpdating = False
If ActiveCell.Column >= F And ActiveCell.Row <= 10 Then
MsgBox "Please click OK and select" _
& vbCrLf & "a row after row 11 and" _
& vbCrLf & "before column E."
Else
ActiveCell.EntireRow.Insert
Set dest = ActiveCell.Worksheet.Cells(ActiveCell.Row, 1)
dest.Offset(1).Resize(, dest.Worksheet.UsedRange.Columns.Count).Copy dest
End If
Application.ScreenUpdating = True
End Sub
I hope someone can help me.
Kind regards,
Little Ghost