Results 1 to 3 of 3

Opening Multiple sheets and inserting password

Threaded View

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    Honduras
    MS-Off Ver
    Excel 2007
    Posts
    2

    Lightbulb Opening Multiple sheets and inserting password

    Well this is my very first post! I am really hoping someone has an interest in reading because I really need some help. I have about 20 files e-mail to me every day that need to be:
    1. openned - half way done. I have the code to open 1 file but not the other 20, who share the same name except for a
    number at the end which is progressive. "formato de inventario 1" then "formato de inventario 2" etc..
    2. insert password = chicken - half way done. I get promted to introduce the password but havent been able to have VBA type "chicken".
    3. unhide columns B and C - done
    4. select range A6:P55 -done
    5. Copy information -done
    6. Paste in a "Master File" for further processing -done

    I am attaching the file that will be used to "centralize" all the information as well as the files we will be copying information from. I am using Excel 2007 on a 64 bit system.
    
    Sub abrir()
    
    ' Opens inventory
    Application.Workbooks.Open ("C:\Users\Trainee\Desktop\Pruebas_2\Formato de Inventario CAEX.xlsx")
    
    'Deactivates protection
    Windows("Formato de Inventario CAEX.xlsx").Activate
        Sheets("Formulario").Select
        ActiveSheet.Unprotect
            
    'Shows hidden columns
    Windows("Formato de Inventario CAEX.xlsx").Activate
        Columns("A:D").Select
        Range("A2").Activate
        Selection.EntireColumn.Hidden = False
    
    'Copies information from Inventory sheet
    Windows("Formato de Inventario CAEX.xlsx").Activate
        Range("B6:P30").Select
        Selection.Copy
        
    'Paste information in MEGA sheet
    Windows("MEGA MEGA 2.xlsm").Activate
        Sheets("Lista 2").Select
        Rows("2:2").Select
        Selection.Insert Shift:=xlDown
    
    'Closes Inventory sheet
    Windows("Formato de Inventario CAEX.xlsx").Activate
        Range("A1").Select
        Application.DisplayAlerts = False
        ActiveWorkbook.Close
        Application.DisplayAlerts = True
            
    End Sub
    Attached Files Attached Files
    Last edited by arlu1201; 03-02-2013 at 01:46 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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