louvalterry
10-30-2013, 03:16 PM
I have a section of code I copied from another worksheet. In this one however all I want to delete is the data not the formating or formulas. The formulas are VLookup from another worksheet to cut down the data needing to be enterred. There seems to be a number of "Clearsomething" but not a ClearValue. How can I change the code below to only remove the data from the row that was copied and then inserted?
myNum = Application.InputBox("Enter number of lines ", "How many Lines ?", 1, , , , , 1)
Do While myNum > 0
With ActiveCell
.EntireRow.Copy
.Offset(1, 0).EntireRow.insert Shift:=xlDown
Range(.Offset(1, 1 - .Column), .Offset(1, 76 - .Column)).ClearContents
.Offset(1, 0).Select
End With
myNum = myNum - 1
Loop
myNum = Application.InputBox("Enter number of lines ", "How many Lines ?", 1, , , , , 1)
Do While myNum > 0
With ActiveCell
.EntireRow.Copy
.Offset(1, 0).EntireRow.insert Shift:=xlDown
Range(.Offset(1, 1 - .Column), .Offset(1, 76 - .Column)).ClearContents
.Offset(1, 0).Select
End With
myNum = myNum - 1
Loop