Macros error when locking cells
Hello!
I don't know anything about macros and I need to find the answer to my question fast. My apologies to all for that. Not lazy, just out of time.
My issue (other than not knowing anything on the subject):
I have a sheet which contains micros - it has a button (created to make it easier for customers) that is supposed to add rows to a specific table. Under that table there is another one, which contains formulas and for that reason needs to be locked. The button works fine and adds rows only when there are no locked cells. If I lock even 1 cell, the button stops working and displays "Run-time error 1004: Insert method of Range class field".
The code is:
Private Sub CommandButton1_Click()
With Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 11))
.Copy
.Insert shift:=xlDown
Application.CutCopyMode = False
End With
Cells(ActiveCell.Row + 1, 1) = "=" & Cells(ActiveCell.Row, 1).Address & "+1"
End Sub
I am clueless, even after several hours of Internet digging. Is it missing the sheet's name, is it my brain that's missing... can't tell. I usually dig and learn, but like I said, time is running out and my boss is breathing down my neck.
Can somebody help me, please... , MUCH, MUCH APPRECIATED!
Irina
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago