I am working on a file with this Macro. This macro copies the data from a form (sheet1) and pastes it horizontally on a blank row in the next sheet. But this is awfully slow..is there anything you guys would recommend to make it run quicker?
Office version: 365
Office version: 365
VBA Code:
Sub SubmitDataWAF()'' SubmitDataWAF Macro' ' ActiveCell.Offset(-2, -2).Range("A1").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(8, -2).Range("A1").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(4, 4).Range("A1").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveWindow.SmallScroll Down:=39 ActiveCell.Offset(45, -6).Range("A1:A4").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(0, 2).Range("A1:A4").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(0, 2).Range("A1:A4").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(0, 2).Range("A1:A4").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _ xlNone, SkipBlanks:=False, Transpose:=True Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveWindow.SmallScroll Down:=-24 ActiveCell.Offset(-39, -1).Range("A1:B1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, -1).Range("A1").Select ActiveSheet.Previous.Select ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveWindow.SmallScroll Down:=18 ActiveCell.Offset(3, -3).Range("A1:E1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 5).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:E1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 5).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:E1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 5).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:E1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:E1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select ActiveCell.Offset(0, 1).Range("A1:C1").Select ActiveSheet.Previous.Select ActiveCell.Offset(-4, -3).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select ActiveSheet.Paste ActiveCell.Offset(0, 3).Range("A1:C1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveCell.Offset(-1, 0).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select ActiveCell.Offset(0, -3).Range("A1:C1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 3).Range("A1:C1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 3).Range("A1:C1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.End(xlToRight).Select Selection.End(xlToLeft).Select ActiveCell.Offset(0, 3).Range("A1:C1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 3).Range("A1:C1").Select ActiveSheet.Previous.Select ActiveCell.Offset(1, 0).Range("A1:C1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(1, 0).Range("A1:C1").Select Selection.End(xlToLeft).Select ActiveCell.Select Sheets("Quality Form").Select ActiveWindow.SmallScroll Down:=-114 ActiveCell.Offset(-52, 7).Range("A1:A6").SelectEnd Sub