zoom38
04-26-2006, 09:50 PM
Anyone know of a way to lock formulas in vba? My problem is that I have a macro that copies a row and then pastes it in the next row. This row has references a row about 30 rows down and I want these refernces changed by 1 which it does. It works and the cell references are correct. Next the macro copies a row that is down further and pastes that in the next row. Here is where the problem occurs. Now in the first row that was copied a cell reference is changed because it references the row that is copied the second time. Basically Im looking to copy and paste a row and then lock those formulas from changing.
Rows("34:34").Select
Selection.Copy
Rows("35:35").Select
Selection.Insert shift:=xlDown
Rows("65:65").Select
Selection.Copy
Rows("66:66").Select
Selection.Insert shift:=xlDown
Rows("96:96").Select
Selection.Copy
Rows("97:97").Select
Selection.Insert shift:=xlDown
Rows("127:127").Select
Selection.Copy
Rows("128:128").Select
Selection.Insert shift:=xlDown
Range("A1").Select
Thanks
Gary
Rows("34:34").Select
Selection.Copy
Rows("35:35").Select
Selection.Insert shift:=xlDown
Rows("65:65").Select
Selection.Copy
Rows("66:66").Select
Selection.Insert shift:=xlDown
Rows("96:96").Select
Selection.Copy
Rows("97:97").Select
Selection.Insert shift:=xlDown
Rows("127:127").Select
Selection.Copy
Rows("128:128").Select
Selection.Insert shift:=xlDown
Range("A1").Select
Thanks
Gary