+ Reply to Thread
Results 1 to 13 of 13

HELP! Import archive sheet - Simple eh?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-27-2016
    Location
    Bradford, UK
    MS-Off Ver
    Home and Student 2013
    Posts
    6

    HELP! Import archive sheet - Simple eh?

    Hi Everyone.

    I am very new to this so please be gentle.

    Problem:
    I want to open an archive sheet in a new workbook, and automatically transfer cells from the archive sheet into different cells on a sheet in the new workbook.

    I have this VBA code (which works great) to find an archive sheet and open it in the new workbook:

    Sub getworkbook()
        ' Get workbook...
        Dim ws As Worksheet
        Dim filter As String
        Dim targetWorkbook As Workbook, wb As Workbook
        Dim Ret As Variant
    
        Set targetWorkbook = Application.ActiveWorkbook
    
        ' get the customer workbook
        filter = "Text files (*.xls),*.xls"
        Caption = "Please Select an input file "
        Ret = Application.GetOpenFilename(filter, , Caption)
    
        If Ret = False Then Exit Sub
    
        Set wb = Workbooks.Open(Ret)
    
        wb.Sheets(1).Move After:=targetWorkbook.Sheets(targetWorkbook.Sheets.Count)
    
        ActiveSheet.Name = "ARCHIVE"
    End Sub
    I first thought that if the cells on the sheet in the new workbook were referenced:

    Formula: copy to clipboard
    =ARCHIVE!C7


    the cell would populate with the value of C7 in the archive sheet, but no (sighs).
    Then I tried:

    Formula: copy to clipboard
    =IF(ISERROR(ARCHIVE!C7),"",ARCHIVE!C7)


    but still no joy.

    So to recap;
    First I want to put formulas in cells in a sheet in the new workbook to automatically (and instantaneously) acquire the value from the specified cells in the archive sheet (when the archive sheet is loaded/opened).

    I may be missing something very basic. It seems like it should be easy but I just can't get Excel to do what I would consider to be quite a simple task.

    Any help ASAP would be greatly appreciated.

    Thanks
    Last edited by moonmonkey; 03-28-2016 at 05:06 AM. Reason: To comply with Rule 3 of the Forum rules (see Post #6)

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: HELP! Import archive sheet - Simple eh?

    =ARCHIVE!C7
    try referencing that as
    sheets("Archive").cells(7,3)

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: HELP! Import archive sheet - Simple eh?

    Maybe
    Range("C7").Value = Sheets("Archive").Range("C7").Value
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Registered User
    Join Date
    03-27-2016
    Location
    Bradford, UK
    MS-Off Ver
    Home and Student 2013
    Posts
    6

    Re: HELP! Import archive sheet - Simple eh?

    Hi rcm & gmr4evr1.

    Thanks for your speedy replies.
    Although I think you may have underestimated my understanding of Excel (I have learnt from scratch the hard way - Trial & error + google). Please could you elaborate on your advice.
    Thanks

  5. #5
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: HELP! Import archive sheet - Simple eh?

    sheets("Archive").cells(7,3)
    'sheets() identifies the worksheet to be referenced
    'cells(row#,column#) or cells(row#,"C")

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: HELP! Import archive sheet - Simple eh?

    code tags added
    Last edited by protonLeah; 03-28-2016 at 06:59 PM.
    Ben Van Johnson

  7. #7
    Registered User
    Join Date
    03-27-2016
    Location
    Bradford, UK
    MS-Off Ver
    Home and Student 2013
    Posts
    6

    Re: HELP! Import archive sheet - Simple eh?

    Thanks again.
    Sorry for my earlier mistakes (which I have corrected).
    Correct me if I'm wrong but it seems the earlier suggestions are in VBA code (to achieve the desired result in only one cell - I used cell C7 as an example but I actually want several cells to be copied). I was hoping to have several FORMULAS in the cells on the new sheet that will populate with the values from the cells from the archive sheet.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: HELP! Import archive sheet - Simple eh?

    code tags added
    Last edited by protonLeah; 03-28-2016 at 06:59 PM.

  9. #9
    Registered User
    Join Date
    03-27-2016
    Location
    Bradford, UK
    MS-Off Ver
    Home and Student 2013
    Posts
    6

    Re: HELP! Import archive sheet - Simple eh?

    Anyone...?
    Last edited by moonmonkey; 03-30-2016 at 05:13 PM.

  10. #10
    Registered User
    Join Date
    03-27-2016
    Location
    Bradford, UK
    MS-Off Ver
    Home and Student 2013
    Posts
    6

    Re: HELP! Import archive sheet - Simple eh?

    Can Anyone help with this now please

  11. #11
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: HELP! Import archive sheet - Simple eh?

    Refering back to post #5, do you have any questions?

  12. #12
    Registered User
    Join Date
    03-27-2016
    Location
    Bradford, UK
    MS-Off Ver
    Home and Student 2013
    Posts
    6

    Re: HELP! Import archive sheet - Simple eh?

    Re: post #5
    Yes. See post #7

  13. #13
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: HELP! Import archive sheet - Simple eh?

    it would be very helpful if you could supply an excel workbook with a sample input (non sensitive) and the desired output

+ 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. [SOLVED] Move row from sheet to archive in a macro
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2016, 09:58 AM
  2. Move a Row to archive sheet - Values Only
    By lyla22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2015, 07:16 PM
  3. Macro to copy a line to archive sheet and delete from active sheet
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2015, 09:15 PM
  4. Trying to Move an entire Row from one sheet to another Archive sheet.. Also..
    By Gurbo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2014, 10:50 AM
  5. Replies: 1
    Last Post: 11-14-2014, 08:35 PM
  6. [SOLVED] Need a macro to copy dates & data from one sheet to an updating archive sheet
    By pbj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2013, 06:58 PM
  7. [SOLVED] Moving a row to archive sheet
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 10:43 AM

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