ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting a range of information from a foler on F Drive to another folder on same drive (https://www.excelbanter.com/excel-programming/273371-re-pasting-range-information-foler-f-drive-another-folder-same-drive.html)

Tom Ogilvy

Pasting a range of information from a foler on F Drive to another folder on same drive
 
This line appears to have a typo:


.range("a1",.range("a65536").end(xlup)(1,4).name = "Jimmy"


should be:
.range("a1",.range("a65536").end(xlup)(1,4)).name = "Jimmy"

and is repeated:
.range("a1",.range("a65536").end(xlup)(1,4).copy _



which should be

.range("a1",.range("a65536").end(xlup))(1,4).copy _


Of course, if the range named Jimmy is already defined, you wouldn't need to
redefine it using the code.

You have said to paste both to 1100 and 1107.

In windows, separators are back slashes

F:\Nave\PGAM

NT based machines seem to be more resiliant with respect to this than
windows 9x machines.

--
Regards,
Tom Ogilvy



Dave Peterson wrote in message
...
Are all the files open?

If not, record a macro when you open it to get that code.

Then (I think) something like:

with workbooks("arbitrage.xls")
.range("a1",.range("a65536").end(xlup)(1,4).name = "Jimmy"
.range("jimmy").copy _
destination:=workbooks("PGAM.xls") _
.worksheets("whatworksheet").range("a1100")
end with

But you didn't need to name the range. You could have just copied it

directly:

with workbooks("arbitrage.xls")
.range("a1",.range("a65536").end(xlup)(1,4).copy _
destination:=workbooks("PGAM.xls") _
.worksheets("whatworksheet").range("a1100")
end with

And when you're adjusting the code, the drive and folder don't go inside

the
workbooks(----) code.

It's just the filename itself.

(But both files have to be open for this to work.)


"Steven R. Berke" wrote:

I have a file on the F:/Drive in a directory named PRU whose name is
Arbitrage. With the command below labeled "A" I have selected the
range I want to copy from the Directory PRU to a file named PGAM
which is on the F:Drive in the Directory Nave(i.e. F:/Nave/PGAM). I
want the range which is named "Jimmy" in the PRU directory to be
pasted into Column A row 1107 of the file named PGAM in the NAVE
directory of the F Drive. What commands should I used to paste the
range named "Jimmy" into row A1100 of the PGAM file

Range("A1", Range("A65536").End(xlUp)(1, 4)).name = "Jimmy" '(LABEL
A)
Range("Jimmy").Select


--

Dave Peterson




Dave Peterson[_3_]

Pasting a range of information from a foler on F Drive to anotherfolder on same drive
 
Oops. Thanks for the correction.

Tom Ogilvy wrote:

This line appears to have a typo:

<<snipped

--

Dave Peterson



All times are GMT +1. The time now is 05:36 PM.

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