Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default PasteSpecial

I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default PasteSpecial

precede the code with
Application.displayalerts = False
Bob Umlas
Excel MVP

"Kevin" wrote in message
...
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default PasteSpecial

try Application.DisplayAlerts = False before it and reset to True after

--

HTH

RP

"Kevin" wrote in message
...
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default PasteSpecial

Thanks Guys! That worked great!

Thanks Again!

Kevin
-----Original Message-----
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?

.

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
pastespecial Jeff Excel Programming 4 September 28th 04 10:30 PM
PasteSpecial KL[_3_] Excel Programming 1 July 8th 04 02:07 PM
Pastespecial and cut Ron[_23_] Excel Programming 4 April 26th 04 02:14 AM
pastespecial in vba cornishbloke[_13_] Excel Programming 7 December 31st 03 01:02 PM
vba pastespecial joao Excel Programming 2 November 14th 03 03:31 PM


All times are GMT +1. The time now is 05:43 AM.

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"