+ Reply to Thread
Results 1 to 2 of 2

list varying data in differen excel folder

Hybrid View

  1. #1
    Registered User
    Join Date
    02-15-2009
    Location
    turkey
    MS-Off Ver
    Excel 2003
    Posts
    1

    list varying data in differen excel folder

    good days
    I want to do application which is about different excel folders. forexample there is a excel folders whose name are aa excel folder and bb excel folder . I want to transfer data in cell a1 in aa excel folder to cell c1 in bb excel folder . and the next time if I change data in aa excel folder it must be tranfer to bb excel folder in c2. in this application data in aa excel folder will be always change; but bb excel folder will list all of them.Hope this explains it alright.

    Thanks in advance.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: list varying data in differen excel folder

    Hello kurish,

    Welcome to the Forum!

    Copy this macro into Excel workbook "aa". The instructions are below. Change the name of "bb" in the code to the name you are using. It is marked in red.
    Private Sub Worksheet_Change(ByVal Target As Range)
    
      Dim LastRow
      Dim NextRow
      Dim StartRow
      Dim Wkb As Workbook
      Dim WkbName As String
      
        If Target.Cells(1, 1).Address <> "$A$1" Then Exit Sub
        
        StartRow = 2   'Column "C" row in workbook "BB"
        WkbName = "BB"
        
        On Error Resume Next
          Set Wkb = Workbooks(WkbName)
          If Err <> 0 Then
             MsgBox "Workbook " & WkbName & " is not open."
             Exit Sub
          End If
        On Error GoTo 0
        
          With Wkb
            LastRow = .Cells(Rows.Count, "C").End(xlUp).Row
            NextRow = IIf(LastRow < StartRow, StartRow, LastRow + 1)
            .Cells(NextRow, "C") = Target.Cells(1, 1)
          End With
             
    End Sub
    How to Save a Worksheet Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open your Workbook and Right Click on the Worksheet's Name Tab for the Worksheet the macro will run on.
    3. Left Click on View Code in the pop up menu.
    4. Paste the macro code using CTRL+V
    5. Make any custom changes to the macro if needed at this time.
    6. Save the macro in your Workbook using CTRL+S
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1