I've managed some issues and my code now is:
Sub pruebas2_funciona()
'
' Macro4 Macro
' Macro recorded 11-01-2011 by amoya
Dim direccion1 As Integer
Dim direccion2 As Integer
Dim dir As Integer
Dim hoja As Worksheet
Dim libro As Workbook
Dim contador As Integer
Dim i As Integer
Dim dirn As Integer
Dim rango As Range
Set libro = ActiveWorkbook
contador = ActiveWorkbook.Worksheets.Count
For i = 2 To contador - 2
Cells.Find(What:="Nave", LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
direccion1 = ActiveCell.Row
Cells.Find(What:="Total Consumo", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
direccion2 = ActiveCell.Row
dir = direccion2 - direccion1
dirn = dir + 9
Range("B" & direccion1, "M" & direccion2).Select
Selection.Copy
Sheets("EA").Select
Range("E8", "P" & dirn).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Rows("8:" & dirn).Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Next i
End Sub
But I can't call the macro from the master sheet
How do I fix that?
When I call the macro from the other sheets, It "kinda" works.. I have some issues with the ranges, so the data appears weird.
Is there a way to store "selection.copy"?
Thank you
Bookmarks