Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
EAHRENS
 
Posts: n/a
Default How to modify a copy macro

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

Sheets("ICS 214").Select
Sheets("ICS 214").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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default How to modify a copy macro

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

HTH
--
AP

"EAHRENS" a écrit dans le message de
...
I am running the following macro to add an additional sheet.

Sheets("ICS 214").Select
Sheets("ICS 214").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?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
EAHRENS
 
Posts: n/a
Default How to modify a copy macro

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 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?

"Ardus Petus" wrote:

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

HTH
--
AP

"EAHRENS" a écrit dans le message de
...
I am running the following macro to add an additional sheet.

Sheets("ICS 214").Select
Sheets("ICS 214").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?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default How to modify a copy macro

Clear the HTH line!

HTH means Hope This Helps

HTH
--
AP

"EAHRENS" a écrit dans le message de
...
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 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?

"Ardus Petus" wrote:

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

HTH
--
AP

"EAHRENS" a écrit dans le message de
...
I am running the following macro to add an additional sheet.

Sheets("ICS 214").Select
Sheets("ICS 214").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?






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
EAHRENS
 
Posts: n/a
Default How to modify a copy macro

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 befo=Sheets(2)
End With

'
End Sub

When I runit I get an error message that

"Ardus Petus" wrote:

Clear the HTH line!

HTH means Hope This Helps

HTH
--
AP

"EAHRENS" a écrit dans le message de
...
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 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?

"Ardus Petus" wrote:

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

HTH
--
AP

"EAHRENS" a écrit dans le message de
...
I am running the following macro to add an additional sheet.

Sheets("ICS 214").Select
Sheets("ICS 214").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?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy from WORD to EXCEL using a macro..... Tee Excel Discussion (Misc queries) 1 March 1st 06 06:46 PM
Want macro to select & copy cells from a different worksheet RocketRod Excel Discussion (Misc queries) 5 February 28th 06 12:53 PM
Recorded Macro to Copy Format Lilbit Excel Worksheet Functions 5 January 10th 06 09:42 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Activate a macro to insert a row and copy the formuals from the rows above to the blank row oil_driller Excel Discussion (Misc queries) 1 February 11th 05 03:30 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"