Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Why does this code not work for me?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick C. Simonds - 23 Jan 2008 07:03 GMT
First, sorry about the double post, but realized I posted my question to the
wrong forum.

Can anyone tell me why this code not only pastes the Formulas (which I want)
but also the values in the cells?

Sub test()

   Dim cellActive As Range
   Set cellActive = ActiveCell

   Dim rgNewRow As Range
   ActiveCell.EntireRow.Insert Shift:=xlDown
   Set rgNewRow = Rows(cellActive.Row - 1)

   cellActive.EntireRow.Copy

   rgNewRow.PasteSpecial (xlPasteFormulas)

End Sub
Nigel - 23 Jan 2008 07:22 GMT
It is correct, the option Formulas takes the 'formula and values' only, in
other words formatting etc, is ignored.

Signature

Regards,
Nigel
nigelnospam@9sw.co.uk

> First, sorry about the double post, but realized I posted my question to
> the wrong forum.
[quoted text clipped - 17 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.