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
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.
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
Re: Excel macro betweek 2 books
unfortunatly still no luck with it. is any1 able to give me a code example
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