+ Reply to Thread
Results 1 to 9 of 9

Workbook reference

Hybrid View

a.hudrea Workbook reference 07-31-2013, 03:16 AM
:) Sixthsense :) Re: Workbook reference 07-31-2013, 03:30 AM
a.hudrea Re: Workbook reference 07-31-2013, 03:46 AM
:) Sixthsense :) Re: Workbook reference 07-31-2013, 03:51 AM
a.hudrea Re: Workbook reference 07-31-2013, 03:53 AM
:) Sixthsense :) Re: Workbook reference 07-31-2013, 03:59 AM
a.hudrea Re: Workbook reference 07-31-2013, 04:27 AM
:) Sixthsense :) Re: Workbook reference 07-31-2013, 04:47 AM
a.hudrea Re: Workbook reference 07-31-2013, 07:51 AM
  1. #1
    Forum Contributor
    Join Date
    07-22-2013
    Location
    Sibiu
    MS-Off Ver
    Excel 2007
    Posts
    114

    Workbook reference

    Hello, this is my situation. I have two workbooks "A" and "D". I have to copy from A to D a certain ammount of info. Now A is always the same file so i can use the workbook's name to refere to, but D is always changing. Any ideea how i can refere to it, tried to do it by index but couldnt figured it out. Only need help with how to refere to the second changeable workbook the rest works.
    Last edited by a.hudrea; 07-31-2013 at 03:29 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Workbook reference

    Just keep two workbooks open and make use of

    Windows(2).Activate


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    07-22-2013
    Location
    Sibiu
    MS-Off Ver
    Excel 2007
    Posts
    114

    Re: Workbook reference

    Thank you so much for the quick and awesome response. I would have one more favour to ask. This work perfectly is there are my first 2 opened workbooks or the onlyones. But if I already have a bunch of workbooks opened how would you sugest that i refer to a dynamic workbook that never has the same name. Thanks in advance.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Workbook reference

    We need something as identifier to identify the relevant workbook. Whether any in string of the workbook name which can help us to locate the workbook?

  5. #5
    Forum Contributor
    Join Date
    07-22-2013
    Location
    Sibiu
    MS-Off Ver
    Excel 2007
    Posts
    114

    Re: Workbook reference

    Yes they have "Calculation" in common but the code after that is different for each workbook. Calculation 824156, Calculation 824157, and os on.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Workbook reference

    Whether multiple workbooks will be kept open with the name Calculation #####

    or

    Just a single file with the name Calculation ##### will be in Open and the rest of the files with different names without having the word Calculation in the file naming?

  7. #7
    Forum Contributor
    Join Date
    07-22-2013
    Location
    Sibiu
    MS-Off Ver
    Excel 2007
    Posts
    114

    Re: Workbook reference

    yes only one with Calculation #####.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Workbook reference

    Try the below code...

    Sub LocateWorkbook()
    Dim W As Window
    
    For Each W In Application.Windows
        If InStr(UCase(W.Parent.Name), "CALCULATION") Then
            Windows(W.Parent.Name).Activate
            Exit For
        End If
    Next W
    
    End Sub

  9. #9
    Forum Contributor
    Join Date
    07-22-2013
    Location
    Sibiu
    MS-Off Ver
    Excel 2007
    Posts
    114

    Re: Workbook reference

    again many thanks and have a lovely day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 06-01-2013, 05:04 AM
  2. [SOLVED] copy active sheet, create new workbook, name new workbook based on cell reference
    By jm0392 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2012, 07:12 PM
  3. Replies: 2
    Last Post: 05-01-2009, 07:06 PM
  4. workbook reference in cell reference: as clearly as i can be...
    By nbsorei in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2008, 03:46 PM
  5. [SOLVED] Column Reference-How do I reference a cell in a different workbook?
    By RMD at JMU in forum Excel General
    Replies: 1
    Last Post: 02-03-2006, 12:00 PM

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