geospatial
Active Member
- Joined
- Sep 2, 2008
- Messages
- 290
So far I have the following code:
The problem I am having is that not all the data is coming over. I am thinking it is because "EQ" does not always have data. What I am needing I guess is the option to use xlUp on A1 and then copy over to EQ.
Code:
Dim folderPath as String
Dim fileName as String
Sub master()
application.displayalerts = False
application.screenupdating = False
Dim wb as Workbook
folderPath = "C:\excel\"
fileName = "Dir(folderPath & "*.xls")
Call clear_sigmaster
Do While fileName <> ""
Set wb = Workbooks.Open(folderPath & fileName)
Call sig_transfer
fileName = Dir()
Loop
End Sub
sub clear_sigmaster()
sheets("Sig_master").Select
Range("A2:EQ62000").Select
Selection.Delete shift:=xlUp
End Sub
Sub sig_transfer()
Windows(fileName).Activate
Sheets("MainReport").select
Rows("1:1").Select
selection.delete shift:=xlup
Range(Range("EP65536").End(xlup), "A1").select
Selection.Copy
Windows("Sig_Afg2011.xlsm").Activate
Sheets ("Paste_Here").Select
Range("A1").select
activesheet.paste
range("A1").Select
windows(filename).Activate
activeWindow.close
sheets("paste_here")
Range("A1").select
Range(Range("EQ65536").End(clup, "A1").Copy Sheets("Sig_master").range("A65536") _
.end(xlup).Offset(1,0)
Sheets("Paste_Here").Cells.Clear
End Sub
The problem I am having is that not all the data is coming over. I am thinking it is because "EQ" does not always have data. What I am needing I guess is the option to use xlUp on A1 and then copy over to EQ.