ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy value from unopened workbook (https://www.excelbanter.com/excel-programming/338728-copy-value-unopened-workbook.html)

Gary Keramidas[_2_]

copy value from unopened workbook
 
is there a way to copy cell values from an unopened workbook and add that
value to an existing value in an opened workbook?

--


Gary




William Benson[_2_]

copy value from unopened workbook
 
A linked cell can be created to an existing workbook with a formula like so:
What amazes me is how the formula text toggles automatically when that
external file is either open or not...
When it is open
='[Bill.xls]Sheet1'!$A$1
When you had it open but it has since been closed
='C:\[Bill.xls]Sheet1'!$A$1

Don't worry, as long as the link was validly created, if you close the
workbook with the formula first, then the external workbook, then open the
workbook with the formula again, the full path will appear.


"Gary Keramidas" wrote in message
...
is there a way to copy cell values from an unopened workbook and add that
value to an existing value in an opened workbook?

--


Gary






Tom Ogilvy

copy value from unopened workbook
 
activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder[MyFile.xls]sheet1'!B9"
ActiveCell.Value = ActiveCell.Value

--
Regards,
Tom Ogilvy

"Gary Keramidas" wrote in message
...
is there a way to copy cell values from an unopened workbook and add that
value to an existing value in an opened workbook?

--


Gary






Gary Keramidas[_2_]

copy value from unopened workbook
 
thanks, i'll give it a shot

--


Gary


"Tom Ogilvy" wrote in message
...
activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder[MyFile.xls]sheet1'!B9"
ActiveCell.Value = ActiveCell.Value

--
Regards,
Tom Ogilvy

"Gary Keramidas" wrote in message
...
is there a way to copy cell values from an unopened workbook and add that
value to an existing value in an opened workbook?

--


Gary








William Benson[_2_]

copy value from unopened workbook
 
OK, Tom, it's always me following up on your posts -- and for the second
time running it is about a command line I do not understand. Terribly sorry!

Why is the line: ActiveCell.Value = ActiveCell.Value required?

Thanks!

Bill

"Tom Ogilvy" wrote in message
...
activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder[MyFile.xls]sheet1'!B9"
ActiveCell.Value = ActiveCell.Value

--
Regards,
Tom Ogilvy

"Gary Keramidas" wrote in message
...
is there a way to copy cell values from an unopened workbook and add that
value to an existing value in an opened workbook?

--


Gary








William Benson[_2_]

copy value from unopened workbook
 
NEvermind, I figured it out ... you are getting rid of the link... got it.

"William Benson" wrote in message
...
OK, Tom, it's always me following up on your posts -- and for the second
time running it is about a command line I do not understand. Terribly
sorry!

Why is the line: ActiveCell.Value = ActiveCell.Value required?

Thanks!

Bill

"Tom Ogilvy" wrote in message
...
activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder[MyFile.xls]sheet1'!B9"
ActiveCell.Value = ActiveCell.Value

--
Regards,
Tom Ogilvy

"Gary Keramidas" wrote in message
...
is there a way to copy cell values from an unopened workbook and add
that
value to an existing value in an opened workbook?

--


Gary










Paul D. Simon

copy value from unopened workbook
 
Tom,

What would be the syntax if the worksheet name was 2 (or more) words,
such as "Last Year" instead of "Sheet1"?

I've tried various combinations of quotation marks, apostrophes and
brackets and can't seem to get it to work.

Thanks,
Paul


Dave Peterson

copy value from unopened workbook
 
Did you try:

activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder[MyFile.xls]last year'!B9"

Sometimes, it's easiest to open that other workbook, build the formula
(manually). Then close the other workbook to see the syntax.

"Paul D. Simon" wrote:

Tom,

What would be the syntax if the worksheet name was 2 (or more) words,
such as "Last Year" instead of "Sheet1"?

I've tried various combinations of quotation marks, apostrophes and
brackets and can't seem to get it to work.

Thanks,
Paul


--

Dave Peterson

Tom Ogilvy

copy value from unopened workbook
 
<blush, i let out the "\" after myfolder.

activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder\[My File.xls]Last Year'!B9"
ActiveCell.Value = ActiveCell.Value

sorry for the confusion.

--
Regards,
Tom Ogilvy



"Paul D. Simon" wrote in message
ups.com...
Tom,

What would be the syntax if the worksheet name was 2 (or more) words,
such as "Last Year" instead of "Sheet1"?

I've tried various combinations of quotation marks, apostrophes and
brackets and can't seem to get it to work.

Thanks,
Paul




Dave Peterson

copy value from unopened workbook
 
Oops. I should have learned to never trust Tom! <vvbg.

And I did build it manually, but just missed it!!

Dave Peterson wrote:

Did you try:

activecell.formula = "=" & ActiveCell.Value &
"+'C:\myfolder[MyFile.xls]last year'!B9"

Sometimes, it's easiest to open that other workbook, build the formula
(manually). Then close the other workbook to see the syntax.

"Paul D. Simon" wrote:

Tom,

What would be the syntax if the worksheet name was 2 (or more) words,
such as "Last Year" instead of "Sheet1"?

I've tried various combinations of quotation marks, apostrophes and
brackets and can't seem to get it to work.

Thanks,
Paul


--

Dave Peterson


--

Dave Peterson

Paul D. Simon

copy value from unopened workbook
 
Thanks very much. Works perfectly!



All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com