Results 1 to 2 of 2

macro that opens files on its own

Threaded View

arnold2508 macro that opens files on its... 08-05-2013, 02:01 PM
patel45 Re: macro that opens files on... 08-05-2013, 03:03 PM
  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    1

    macro that opens files on its own

    Hey guys,
    I need to import columns from over 600 files for my work and I think a macro could help me out there. But I need some help (or quite a lot actually). I cant really program macros but I managed to make it do the things that I want by recording one. Well almost. I dont know how to make it open a file without me typing the filename. It would be great if it could just open one file, do the whole procedure, save it and then do the same thing to the next file.
    Here's my basic macro:

    Sub Macro3()
    '
    ' Macro3 Macro
    '
    
    '
        Windows("2013.08.05 - 10453 - Analyse.xml").Activate
        Range("C3:E20").Select
        Selection.Copy
        Windows("Blankomappe.xlsx").Activate
        Range("A2").Select
        ActiveSheet.Paste
        Windows("2013.08.05 - 10453 - Analyse.xml").Activate
        Range("G3:H20").Select
        Application.CutCopyMode = False
        Selection.Copy
        Windows("Blankomappe.xlsx").Activate
        Range("D2").Select
        ActiveSheet.Paste
        Windows("2013.08.05 - 10453 - Analyse.xml").Activate
        Range("J3:J20").Select
        Application.CutCopyMode = False
        Selection.Copy
        Windows("Blankomappe.xlsx").Activate
        Range("F2").Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
        Selection.NumberFormat = "0"
        Windows("2013.08.05 - 10453 - Analyse.xml").Activate
        Range("K3:N20").Select
        Selection.Copy
        Windows("Blankomappe.xlsx").Activate
        Range("H2").Select
        ActiveSheet.Paste
        Range("J2:K19").Select
        Range("J19").Activate
        Application.CutCopyMode = False
        Selection.NumberFormat = "0"
        Range("K10").Select
        Windows("2013.08.05 - 10453 - Analyse.xml").Activate
        Range("P3:Q20").Select
        Selection.Copy
        Windows("Blankomappe.xlsx").Activate
        Range("O2").Select
        ActiveSheet.Paste
        Range("D15").Select
        
    End Sub
    "2013.08.05 - 10453 - Analyse.xml" is the file it needs to extract the data from. The other files have similar names.
    I left the save function out there but I tried it before with it and it worked. But theres another thing: I want it to delete empty rows. I used this and just copy and pasted it to the end of my macro but sadly it didnt work.

    Option Explicit
    
    Sub DeleteBlanks()
        
        Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    
    End Sub
    If someone could help me out here, that would be so awesome.

    Edit: Maybe I should say this: I need to create a seperate file for each file that I take the data from
    Last edited by arnold2508; 08-05-2013 at 02:09 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro that Opens files, updates links, saves and closes file
    By dandavis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2011, 04:28 AM
  2. Macro that opens and closes many files uses too much memory
    By Whizbang in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2010, 04:31 PM
  3. Opens 2 files the same
    By Ollie in forum Excel General
    Replies: 1
    Last Post: 03-08-2006, 10:15 PM
  4. Excel Opens two files
    By lara5555 in forum Excel General
    Replies: 1
    Last Post: 02-20-2006, 11:10 AM
  5. Excel opens S L O W from XLS files
    By raaone in forum Excel General
    Replies: 0
    Last Post: 02-09-2005, 03:27 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