Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy many files into one
Hi,
I want to copy the usedranges from many files into one excel file. I want those usedranges to be appended to the last column and not to the last row. I thought that this part would do it, but it doesn't Destination:=TargetSht.Cells(1, Columns.Count).End(xlLeft).Offset(0, 1) Can anyone help please ? Thank you Gabriel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy many files into one
Hi Gabriel
See this page for a example http://www.rondebruin.nl/copy3.htm#column Note: you only have 256 columns -- Regards Ron de Bruin http://www.rondebruin.nl "Gabriel" wrote in message om... Hi, I want to copy the usedranges from many files into one excel file. I want those usedranges to be appended to the last column and not to the last row. I thought that this part would do it, but it doesn't Destination:=TargetSht.Cells(1, Columns.Count).End(xlLeft).Offset(0, 1) Can anyone help please ? Thank you Gabriel |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy many files into one
You can also use a function to find the last column with data
Function Lastcol(sh As Worksheet) On Error Resume Next Lastcol = sh.Cells.Find(What:="*", _ After:=sh.Range("A1"), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Column On Error GoTo 0 End FunctionSub test() MsgBox Lastcol(ActiveSheet) End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... Hi Gabriel See this page for a example http://www.rondebruin.nl/copy3.htm#column Note: you only have 256 columns -- Regards Ron de Bruin http://www.rondebruin.nl "Gabriel" wrote in message om... Hi, I want to copy the usedranges from many files into one excel file. I want those usedranges to be appended to the last column and not to the last row. I thought that this part would do it, but it doesn't Destination:=TargetSht.Cells(1, Columns.Count).End(xlLeft).Offset(0, 1) Can anyone help please ? Thank you Gabriel |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy many files into one
This is a mess<g
Try this You can also use a function to find the last column with data Function Lastcol(sh As Worksheet) On Error Resume Next Lastcol = sh.Cells.Find(What:="*", _ After:=sh.Range("A1"), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Column On Error GoTo 0 End Function Sub test() MsgBox Lastcol(ActiveSheet) End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... You can also use a function to find the last column with data Function Lastcol(sh As Worksheet) On Error Resume Next Lastcol = sh.Cells.Find(What:="*", _ After:=sh.Range("A1"), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Column On Error GoTo 0 End FunctionSub test() MsgBox Lastcol(ActiveSheet) End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... Hi Gabriel See this page for a example http://www.rondebruin.nl/copy3.htm#column Note: you only have 256 columns -- Regards Ron de Bruin http://www.rondebruin.nl "Gabriel" wrote in message om... Hi, I want to copy the usedranges from many files into one excel file. I want those usedranges to be appended to the last column and not to the last row. I thought that this part would do it, but it doesn't Destination:=TargetSht.Cells(1, Columns.Count).End(xlLeft).Offset(0, 1) Can anyone help please ? Thank you Gabriel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and Paste Between Files | Excel Discussion (Misc queries) | |||
copy files | Excel Programming | |||
Copy Files | Excel Programming | |||
Copy values between files. | Excel Programming | |||
copy files from one dir to another | Excel Programming |