How to modify a copy macro

E

EAHRENS

I am running the following macro to add an additional sheet.

Sheets("ICS 214").Select
Sheets("ICS 214").Copy Before:=Sheets(2)
'
End Sub

The problem I have is it copies over some information from unlocked cells
that I would like to have blank on the new sheet. What can i add to the macro
to have it copy the original sheet and automatically clear a group of cells
such as d29-d46?
 
A

Ardus Petus

With Sheets(("ICS 214")
.range("D29:D46").clearcontents
.copy before:= Sheets(2)
end with

HTH
 
E

EAHRENS

I apparently am not smart enough to apply your fix and need a lower level of
help. I changed the macro and it now reads:

Sub ICS214()
'
' ICS214 Macro
' Macro recorded 10/5/2005 by Eric Ahrens
'
With Sheets("ICS 214")
..Range("D29:D46").ClearContents
.Copy before:=Sheets(2)
End With
HTH
--

'
End Sub

When I run it, I get an errof message sub not defined and HTH is
highlighted. What did I do wrong?
 
E

EAHRENS

I figured I was doing something wrong. i removed it and now get an error
message that reads: Run-time error 1004, Cannot change part of a merged cell.
Debug highlights .Range("D29:D46").ClearContents

The macro I am running reads:

Sub ICS214()
'
' ICS214 Macro
' Macro recorded 10/5/2005 by Eric Ahrens
'
With Sheets("ICS 214")
..Range("D29:D46").ClearContents
.Copy before:=Sheets(2)
End With

'
End Sub

When I runit I get an error message that
 
Top