close

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

Sheets(quot;ICS 214quot;).Select
Sheets(quot;ICS 214quot;).Copy Befo=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?

With Sheets((quot;ICS 214quot;)
.range(quot;D2946quot;).clearcontents
.copy befo= Sheets(2)
end with

HTH
--
AP

quot;EAHRENSquot; gt; a écrit dans le message de
...
gt; I am running the following macro to add an additional sheet.
gt;
gt; Sheets(quot;ICS 214quot;).Select
gt; Sheets(quot;ICS 214quot;).Copy Befo=Sheets(2)
gt; '
gt; End Sub
gt;
gt; The problem I have is it copies over some information from unlocked cells
gt; that I would like to have blank on the new sheet. What can i add to the
macro
gt; to have it copy the original sheet and automatically clear a group of
cells
gt; such as d29-d46?
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(quot;ICS 214quot;)
..Range(quot;D2946quot;).ClearContents
.Copy befo=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?

quot;Ardus Petusquot; wrote:

gt; With Sheets((quot;ICS 214quot;)
gt; .range(quot;D2946quot;).clearcontents
gt; .copy befo= Sheets(2)
gt; end with
gt;
gt; HTH
gt; --
gt; AP
gt;
gt; quot;EAHRENSquot; gt; a écrit dans le message de
gt; ...
gt; gt; I am running the following macro to add an additional sheet.
gt; gt;
gt; gt; Sheets(quot;ICS 214quot;).Select
gt; gt; Sheets(quot;ICS 214quot;).Copy Befo=Sheets(2)
gt; gt; '
gt; gt; End Sub
gt; gt;
gt; gt; The problem I have is it copies over some information from unlocked cells
gt; gt; that I would like to have blank on the new sheet. What can i add to the
gt; macro
gt; gt; to have it copy the original sheet and automatically clear a group of
gt; cells
gt; gt; such as d29-d46?
gt;
gt;
gt;

Clear the HTH line!

HTH means Hope This Helps

HTH
--
AP

quot;EAHRENSquot; gt; a écrit dans le message de
...
gt; I apparently am not smart enough to apply your fix and need a lower level
of
gt; help. I changed the macro and it now reads:
gt;
gt; Sub ICS214()
gt; '
gt; ' ICS214 Macro
gt; ' Macro recorded 10/5/2005 by Eric Ahrens
gt; '
gt; With Sheets(quot;ICS 214quot;)
gt; .Range(quot;D2946quot;).ClearContents
gt; .Copy befo=Sheets(2)
gt; End With
gt; HTH
gt; --
gt;
gt; '
gt; End Sub
gt;
gt; When I run it, I get an errof message sub not defined and HTH is
gt; highlighted. What did I do wrong?
gt;
gt; quot;Ardus Petusquot; wrote:
gt;
gt; gt; With Sheets((quot;ICS 214quot;)
gt; gt; .range(quot;D2946quot;).clearcontents
gt; gt; .copy befo= Sheets(2)
gt; gt; end with
gt; gt;
gt; gt; HTH
gt; gt; --
gt; gt; AP
gt; gt;
gt; gt; quot;EAHRENSquot; gt; a écrit dans le message de
gt; gt; ...
gt; gt; gt; I am running the following macro to add an additional sheet.
gt; gt; gt;
gt; gt; gt; Sheets(quot;ICS 214quot;).Select
gt; gt; gt; Sheets(quot;ICS 214quot;).Copy Befo=Sheets(2)
gt; gt; gt; '
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt; The problem I have is it copies over some information from unlocked
cells
gt; gt; gt; that I would like to have blank on the new sheet. What can i add to
the
gt; gt; macro
gt; gt; gt; to have it copy the original sheet and automatically clear a group of
gt; gt; cells
gt; gt; gt; such as d29-d46?
gt; gt;
gt; gt;
gt; gt;
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(quot;D2946quot;).ClearContents

The macro I am running reads:

Sub ICS214()
'
' ICS214 Macro
' Macro recorded 10/5/2005 by Eric Ahrens
'
With Sheets(quot;ICS 214quot;)
..Range(quot;D2946quot;).ClearContents
.Copy befo=Sheets(2)
End With

'
End Sub

When I runit I get an error message that

quot;Ardus Petusquot; wrote:

gt; Clear the HTH line!
gt;
gt; HTH means Hope This Helps
gt;
gt; HTH
gt; --
gt; AP
gt;
gt; quot;EAHRENSquot; gt; a écrit dans le message de
gt; ...
gt; gt; I apparently am not smart enough to apply your fix and need a lower level
gt; of
gt; gt; help. I changed the macro and it now reads:
gt; gt;
gt; gt; Sub ICS214()
gt; gt; '
gt; gt; ' ICS214 Macro
gt; gt; ' Macro recorded 10/5/2005 by Eric Ahrens
gt; gt; '
gt; gt; With Sheets(quot;ICS 214quot;)
gt; gt; .Range(quot;D2946quot;).ClearContents
gt; gt; .Copy befo=Sheets(2)
gt; gt; End With
gt; gt; HTH
gt; gt; --
gt; gt;
gt; gt; '
gt; gt; End Sub
gt; gt;
gt; gt; When I run it, I get an errof message sub not defined and HTH is
gt; gt; highlighted. What did I do wrong?
gt; gt;
gt; gt; quot;Ardus Petusquot; wrote:
gt; gt;
gt; gt; gt; With Sheets((quot;ICS 214quot;)
gt; gt; gt; .range(quot;D2946quot;).clearcontents
gt; gt; gt; .copy befo= Sheets(2)
gt; gt; gt; end with
gt; gt; gt;
gt; gt; gt; HTH
gt; gt; gt; --
gt; gt; gt; AP
gt; gt; gt;
gt; gt; gt; quot;EAHRENSquot; gt; a écrit dans le message de
gt; gt; gt; ...
gt; gt; gt; gt; I am running the following macro to add an additional sheet.
gt; gt; gt; gt;
gt; gt; gt; gt; Sheets(quot;ICS 214quot;).Select
gt; gt; gt; gt; Sheets(quot;ICS 214quot;).Copy Befo=Sheets(2)
gt; gt; gt; gt; '
gt; gt; gt; gt; End Sub
gt; gt; gt; gt;
gt; gt; gt; gt; The problem I have is it copies over some information from unlocked
gt; cells
gt; gt; gt; gt; that I would like to have blank on the new sheet. What can i add to
gt; the
gt; gt; gt; macro
gt; gt; gt; gt; to have it copy the original sheet and automatically clear a group of
gt; gt; gt; cells
gt; gt; gt; gt; such as d29-d46?
gt; gt; gt;
gt; gt; gt;
gt; gt; gt;
gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()