Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 23rd, 2005, 01:28 AM
ct ct is offline
Authorized User
 
Join Date: Aug 2005
Location: as, kedah, Malaysia.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default copy value in VB

ii..i have a problem to copy the value..for the example...in "sheet1" in column "A1" have value=2 and at the same time the column in "A1" have a formula "=Sheet2!A1"....how i want to copy the value from column "A1" to column "A5" in the same sheet"Sheet1"... i can't use this coding...

With Worksheets("Sheet1")
    .Range("A1").Copy
    .Range("A5").PasteSpecial _
        Operation:=xlPasteSpecialOperationAdd
End With

this coding doesn't work in this situation...it is because the value in A1 have a formula....can u help me solve this problem..tq very much


Reply With Quote
  #2 (permalink)  
Old August 23rd, 2005, 02:38 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

replace your last line of code with the following.

.Range("A5").PasteSpecial Paste:=xlValues, Operation:=xlAdd

cheers

Matt

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Copy a File using VB 2005? phenom BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 11 July 31st, 2008 01:23 AM
Copy DataSet prasanta2expert ASP.NET 1.0 and 1.1 Professional 1 January 22nd, 2007 09:30 AM
Copy excel macros to vb project battlebob Excel VBA 2 November 9th, 2004 10:13 AM
Copy to Clipboard Clive Astley Access 5 July 16th, 2004 07:16 PM
Copy word to word doc. in VB vamshi Pro VB 6 1 March 24th, 2004 06:25 PM



All times are GMT -4. The time now is 02:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.