Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2012, 09:42 AM
Catalin.B Catalin.B is offline linking in excel Windows Vista linking in excel Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, România
Posts: 386
Catalin.B is on a distinguished road
Default

Upload a file with a list of source files names, and specify the range of cells you need from these files, i will give you a sample code...
Reply With Quote
  #2  
Old 07-22-2012, 09:55 AM
OssOss OssOss is offline linking in excel Windows 7 64bit linking in excel Office 2010 64bit
Novice
linking in excel
 
Join Date: Jul 2012
Posts: 4
OssOss is on a distinguished road
Default incoming

Well im sending those fils well i must say o owe you a big time thank you in advance
Attached Files
File Type: xlsx Test.xlsx (8.2 KB, 13 views)
Reply With Quote
  #3  
Old 07-22-2012, 10:48 AM
Catalin.B Catalin.B is offline linking in excel Windows Vista linking in excel Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, România
Posts: 386
Catalin.B is on a distinguished road
Default

This is the code you will find in the file attached. Just press the start button , in the browse window that comes up, navigate to the folder that contains your source files and double click any file from that folder; the code opens every file from that folder and copies cells A58 to column D.
Code:
Option Explicit
Sub ChangeLinks()
Application.ScreenUpdating = False
Dim NewLnk As String
 
NewLnk = Application.GetOpenFilename("Excel files,*.xl*", _
                           1, "Choose any file in the source folder", , False)
                           
       If TypeName(NewLnk) = "Boolean" Then Exit Sub
       
    Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")

Dim Fisier, FolderSursa As String, LastRow As Long
LastRow = ThisWorkbook.Sheets("1000000").Range("D" & Rows.Count).End(xlUp).Row
  FolderSursa = oFSO.GetFile(NewLnk).ParentFolder
         For Each Fisier In oFSO.GetFolder(FolderSursa).Files
            Workbooks.Open (Fisier)
            ActiveSheet.Cells(58, "A").Copy
            ThisWorkbook.Activate
            ThisWorkbook.Sheets("1000000").Cells(LastRow + 1, "D").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
            Workbooks(Fisier.Name).Close savechanges:=False
            LastRow = LastRow + 1
         Next
         
 
End Sub
Attached Files
File Type: xlsm Test-v1.xlsm (20.6 KB, 11 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
linking in excel linking to excel from word jillapass Word VBA 5 06-08-2012 01:28 AM
linking in excel linking word from Excel Lorna B Word 1 03-22-2012 03:36 PM
Excel to powerpoint linking mugezhn Excel 0 07-08-2010 02:56 AM
Linking Excel to Word engineer_in_training Word 0 01-06-2010 01:30 PM
Linking from Excel to Word streng Word 4 10-28-2008 08:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft