|
-
Jun 8th, 2006, 05:11 AM
#1
Thread Starter
New Member
Excel macro betweek 2 books
Hi all,
I am writing a macro to copy the data in a cell in 1 excell book (book1) to another (book2)
the cell in book1 displays an answer to a formula that takes information from other cells in the book. all i want displayed in book2 is the answer that the formula in book1 gives. the problem i am comming across is that when i paste into the other book (book2) it gives me an error because it is trying to do the sum in the formula and the information is not in the cells in book2, there in book1. so basicly i only want the answer (displayed in the cell on book1) on book 2.
Can any1 help me with this as its consumed most of my morning at work lol
Thanks all
Mark
-
Jun 8th, 2006, 05:19 AM
#2
Re: Excel macro betweek 2 books
Code : pasteSpecial <--- look at the help file on this in the vba editor.
You need to use special values.
the alternative is to record yourself doing the copy and paste, then look at the code amd tweak as you need to.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 8th, 2006, 05:21 AM
#3
Thread Starter
New Member
Re: Excel macro betweek 2 books
thanks, i have tried recording it already and then customising the rest of the code but i still get the errors even when using a paste special. will try using the help files and will get back to u
-
Jun 8th, 2006, 05:31 AM
#4
Thread Starter
New Member
Re: Excel macro betweek 2 books
unfortunatly still no luck with it. is any1 able to give me a code example
-
Jun 9th, 2006, 04:41 PM
#5
Junior Member
Re: Excel macro betweek 2 books
Perhaps I am not understanding the full gravity of your project, but if all you want to do is show the value of the a cell from another book, couldn't you just type '=' in the cell and then the cell you want to copy from? This works even from another book, and if you need it to be more dynamic, certainly you could code in the reference to the other cell?
='[Sales Activity.xls]Sheet1'!$I$14
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|