L
LiAD
Evening,
I have three macros which i need to run off one button. The first two run
fine but the third wont run. Can anyone tell me what I need to change to get
them all to run simultaneously?
Thanks
LiAD
Sub CreateComposition()
'AM to DJ
Dim lngRow As Long
For lngRow = 237 To 437
Call CopySpecialCells(lngRow, lngRow + 202)
Next
End Sub
Sub CopySpecialCells(lngSourceRow As Long, lngTargetRow As Long)
lngTemp = 39
For lngCol = 39 To 105
If IsNumeric(Cells(lngSourceRow, lngCol)) = False Then
Cells(lngTargetRow, lngTemp) = Cells(lngSourceRow, lngCol)
lngTemp = lngTemp + 1
End If
Next
End Sub
Sub FillPlanningSheet()
'
Columns("N:N").Select
Selection.EntireColumn.Hidden = True
Selection.AutoFilter Field:=5, Criteria1:="CB190"
Columns("F:F").Select
Selection.EntireColumn.Hidden = True
Range("C48:O250").Select
Selection.Copy
Sheets("CB190").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll ToRight:=10
Sheets("Base Planif.").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
Range("R48:R250").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CB190").Select
Range("N10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Base Planif.").Select
Range("P48250").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CB190").Select
Range("U10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("Base Planif.").Select
Application.CutCopyMode = False
ActiveWindow.SmallScroll ToRight:=-6
Columns("M:O").Select
Selection.EntireColumn.Hidden = False
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Columns("C:G").Select
Selection.EntireColumn.Hidden = False
Columns("D").Select
Selection.EntireColumn.Hidden = True
Selection.AutoFilter Field:=5
Range("A1").Select
End Sub
I have three macros which i need to run off one button. The first two run
fine but the third wont run. Can anyone tell me what I need to change to get
them all to run simultaneously?
Thanks
LiAD
Sub CreateComposition()
'AM to DJ
Dim lngRow As Long
For lngRow = 237 To 437
Call CopySpecialCells(lngRow, lngRow + 202)
Next
End Sub
Sub CopySpecialCells(lngSourceRow As Long, lngTargetRow As Long)
lngTemp = 39
For lngCol = 39 To 105
If IsNumeric(Cells(lngSourceRow, lngCol)) = False Then
Cells(lngTargetRow, lngTemp) = Cells(lngSourceRow, lngCol)
lngTemp = lngTemp + 1
End If
Next
End Sub
Sub FillPlanningSheet()
'
Columns("N:N").Select
Selection.EntireColumn.Hidden = True
Selection.AutoFilter Field:=5, Criteria1:="CB190"
Columns("F:F").Select
Selection.EntireColumn.Hidden = True
Range("C48:O250").Select
Selection.Copy
Sheets("CB190").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll ToRight:=10
Sheets("Base Planif.").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
Range("R48:R250").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CB190").Select
Range("N10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Base Planif.").Select
Range("P48250").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CB190").Select
Range("U10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("Base Planif.").Select
Application.CutCopyMode = False
ActiveWindow.SmallScroll ToRight:=-6
Columns("M:O").Select
Selection.EntireColumn.Hidden = False
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Columns("C:G").Select
Selection.EntireColumn.Hidden = False
Columns("D").Select
Selection.EntireColumn.Hidden = True
Selection.AutoFilter Field:=5
Range("A1").Select
End Sub