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
Bookmarks