Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop until finished
I need this to loop until it gets all the copy and pasting done.
Sub FormatPage4() Application.ScreenUpdating = False em = Range("A2").Value em = Range("A450").Value em = Range("A898").Value em = Range("A1346").Value em = Range("A1794").Value Sheets("export_perf_stats_by_center").Select Cells.Select With Selection .VerticalAlignment = xlBottom .Orientation = 0 .AddIndent = False .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Sheets("export_perf_stats_by_center").Select Range("A1").Select Columns("B:D").EntireColumn.Hidden = True Columns("G:H").EntireColumn.Hidden = True Columns("K:S").EntireColumn.Hidden = True Columns("AA:AG").EntireColumn.Hidden = True Selection.AutoFilter Field:=5, Criteria1:=em Range("A2:Z449").Select Selection.Copy Sheets("Sheet1").Select Range("A4").Select --------A15,,,so one down the line Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ True, Transpose:=False Application.CutCopyMode = False Sheets("export_perf_stats_by_center").Select Selection.AutoFilter Field:=5 Rows("1:2").EntireRow.Hidden = False Columns("B:D").EntireColumn.Hidden = False Columns("G:H").EntireColumn.Hidden = False Columns("K:S").EntireColumn.Hidden = False Columns("AA:AG").EntireColumn.Hidden = False Range("A1").Select Sheets("Sheet1").Select Range("A4:A30").Select Selection.Cut Range("C4").Select ActiveSheet.Paste Range("B4:B30").Select Selection.ClearContents Range("C4:M30").Select Selection.Sort Key1:=Range("C4"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal HideRowsWithZeroAHT Range("A3:C3").Select ActiveCell.FormulaR1C1 = "=MAX(R[1]C[2]:R[27]C[2])" Range("B4").Select Range("A1").Select End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop until finished
David
Your code, as written, doesn't make any sense. Please post back and explain what you want to do. Provide as much detail as you can. HTH Otto "David A." wrote in message ... I need this to loop until it gets all the copy and pasting done. Sub FormatPage4() Application.ScreenUpdating = False em = Range("A2").Value em = Range("A450").Value em = Range("A898").Value em = Range("A1346").Value em = Range("A1794").Value Sheets("export_perf_stats_by_center").Select Cells.Select With Selection .VerticalAlignment = xlBottom .Orientation = 0 .AddIndent = False .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Sheets("export_perf_stats_by_center").Select Range("A1").Select Columns("B:D").EntireColumn.Hidden = True Columns("G:H").EntireColumn.Hidden = True Columns("K:S").EntireColumn.Hidden = True Columns("AA:AG").EntireColumn.Hidden = True Selection.AutoFilter Field:=5, Criteria1:=em Range("A2:Z449").Select Selection.Copy Sheets("Sheet1").Select Range("A4").Select --------A15,,,so one down the line Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ True, Transpose:=False Application.CutCopyMode = False Sheets("export_perf_stats_by_center").Select Selection.AutoFilter Field:=5 Rows("1:2").EntireRow.Hidden = False Columns("B:D").EntireColumn.Hidden = False Columns("G:H").EntireColumn.Hidden = False Columns("K:S").EntireColumn.Hidden = False Columns("AA:AG").EntireColumn.Hidden = False Range("A1").Select Sheets("Sheet1").Select Range("A4:A30").Select Selection.Cut Range("C4").Select ActiveSheet.Paste Range("B4:B30").Select Selection.ClearContents Range("C4:M30").Select Selection.Sort Key1:=Range("C4"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal HideRowsWithZeroAHT Range("A3:C3").Select ActiveCell.FormulaR1C1 = "=MAX(R[1]C[2]:R[27]C[2])" Range("B4").Select Range("A1").Select End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop until finished
Ok,
Its very confuing.... I am filtering for names that are found on page "Sheet1" on "export_perf_stats_by_center" page, then coping that filtered information to back to "Sheet1" and I need to do this with 15-20 names. A2: first name A450:second name and so on. "Otto Moehrbach" wrote: David Your code, as written, doesn't make any sense. Please post back and explain what you want to do. Provide as much detail as you can. HTH Otto "David A." wrote in message ... I need this to loop until it gets all the copy and pasting done. Sub FormatPage4() Application.ScreenUpdating = False em = Range("A2").Value em = Range("A450").Value em = Range("A898").Value em = Range("A1346").Value em = Range("A1794").Value Sheets("export_perf_stats_by_center").Select Cells.Select With Selection .VerticalAlignment = xlBottom .Orientation = 0 .AddIndent = False .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Sheets("export_perf_stats_by_center").Select Range("A1").Select Columns("B:D").EntireColumn.Hidden = True Columns("G:H").EntireColumn.Hidden = True Columns("K:S").EntireColumn.Hidden = True Columns("AA:AG").EntireColumn.Hidden = True Selection.AutoFilter Field:=5, Criteria1:=em Range("A2:Z449").Select Selection.Copy Sheets("Sheet1").Select Range("A4").Select --------A15,,,so one down the line Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ True, Transpose:=False Application.CutCopyMode = False Sheets("export_perf_stats_by_center").Select Selection.AutoFilter Field:=5 Rows("1:2").EntireRow.Hidden = False Columns("B:D").EntireColumn.Hidden = False Columns("G:H").EntireColumn.Hidden = False Columns("K:S").EntireColumn.Hidden = False Columns("AA:AG").EntireColumn.Hidden = False Range("A1").Select Sheets("Sheet1").Select Range("A4:A30").Select Selection.Cut Range("C4").Select ActiveSheet.Paste Range("B4:B30").Select Selection.ClearContents Range("C4:M30").Select Selection.Sort Key1:=Range("C4"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal HideRowsWithZeroAHT Range("A3:C3").Select ActiveCell.FormulaR1C1 = "=MAX(R[1]C[2]:R[27]C[2])" Range("B4").Select Range("A1").Select End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop until finished
David
I know that you understand perfectly what you are saying, but you are the only one that does. You must understand that you are talking to people who know nothing about what you are doing, what you want, or how you want to do it. You say: A2: first name A450:second name and so on. What's in all the other cells? One way of explaining what you want is to give us a step-by-step explanation of how YOU would do this if you had to do it manually. HTH Otto "David A." wrote in message ... Ok, Its very confuing.... I am filtering for names that are found on page "Sheet1" on "export_perf_stats_by_center" page, then coping that filtered information to back to "Sheet1" and I need to do this with 15-20 names. A2: first name A450:second name and so on. "Otto Moehrbach" wrote: David Your code, as written, doesn't make any sense. Please post back and explain what you want to do. Provide as much detail as you can. HTH Otto "David A." wrote in message ... I need this to loop until it gets all the copy and pasting done. Sub FormatPage4() Application.ScreenUpdating = False em = Range("A2").Value em = Range("A450").Value em = Range("A898").Value em = Range("A1346").Value em = Range("A1794").Value Sheets("export_perf_stats_by_center").Select Cells.Select With Selection .VerticalAlignment = xlBottom .Orientation = 0 .AddIndent = False .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Sheets("export_perf_stats_by_center").Select Range("A1").Select Columns("B:D").EntireColumn.Hidden = True Columns("G:H").EntireColumn.Hidden = True Columns("K:S").EntireColumn.Hidden = True Columns("AA:AG").EntireColumn.Hidden = True Selection.AutoFilter Field:=5, Criteria1:=em Range("A2:Z449").Select Selection.Copy Sheets("Sheet1").Select Range("A4").Select --------A15,,,so one down the line Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ True, Transpose:=False Application.CutCopyMode = False Sheets("export_perf_stats_by_center").Select Selection.AutoFilter Field:=5 Rows("1:2").EntireRow.Hidden = False Columns("B:D").EntireColumn.Hidden = False Columns("G:H").EntireColumn.Hidden = False Columns("K:S").EntireColumn.Hidden = False Columns("AA:AG").EntireColumn.Hidden = False Range("A1").Select Sheets("Sheet1").Select Range("A4:A30").Select Selection.Cut Range("C4").Select ActiveSheet.Paste Range("B4:B30").Select Selection.ClearContents Range("C4:M30").Select Selection.Sort Key1:=Range("C4"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal HideRowsWithZeroAHT Range("A3:C3").Select ActiveCell.FormulaR1C1 = "=MAX(R[1]C[2]:R[27]C[2])" Range("B4").Select Range("A1").Select End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop until finished
Sorry,
I have a list of names on Sheet1 in column A (In cells: A1,A7,A14......) I have data on Sheet2 that I need to filter for that name (A1-"Tom",A7-"Dick",A14-"Harry".....). Once Sheet2 is filtered for that name(A1-"Tom") it copies that filtered data. That data is then pasted to Sheet1 (Location: B2). Its aboout 2-3 lines of data. I need it to continue to filter and copy for each the names in column A and paste it to a given location.(B2,B8,B15....) on Sheet1. Once it gets to the end of the list of names I need it to stop. "Otto Moehrbach" wrote: David I know that you understand perfectly what you are saying, but you are the only one that does. You must understand that you are talking to people who know nothing about what you are doing, what you want, or how you want to do it. You say: A2: first name A450:second name and so on. What's in all the other cells? One way of explaining what you want is to give us a step-by-step explanation of how YOU would do this if you had to do it manually. HTH Otto "David A." wrote in message ... Ok, Its very confuing.... I am filtering for names that are found on page "Sheet1" on "export_perf_stats_by_center" page, then coping that filtered information to back to "Sheet1" and I need to do this with 15-20 names. A2: first name A450:second name and so on. "Otto Moehrbach" wrote: David Your code, as written, doesn't make any sense. Please post back and explain what you want to do. Provide as much detail as you can. HTH Otto "David A." wrote in message ... I need this to loop until it gets all the copy and pasting done. Sub FormatPage4() Application.ScreenUpdating = False em = Range("A2").Value em = Range("A450").Value em = Range("A898").Value em = Range("A1346").Value em = Range("A1794").Value Sheets("export_perf_stats_by_center").Select Cells.Select With Selection .VerticalAlignment = xlBottom .Orientation = 0 .AddIndent = False .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Sheets("export_perf_stats_by_center").Select Range("A1").Select Columns("B:D").EntireColumn.Hidden = True Columns("G:H").EntireColumn.Hidden = True Columns("K:S").EntireColumn.Hidden = True Columns("AA:AG").EntireColumn.Hidden = True Selection.AutoFilter Field:=5, Criteria1:=em Range("A2:Z449").Select Selection.Copy Sheets("Sheet1").Select Range("A4").Select --------A15,,,so one down the line Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ True, Transpose:=False Application.CutCopyMode = False Sheets("export_perf_stats_by_center").Select Selection.AutoFilter Field:=5 Rows("1:2").EntireRow.Hidden = False Columns("B:D").EntireColumn.Hidden = False Columns("G:H").EntireColumn.Hidden = False Columns("K:S").EntireColumn.Hidden = False Columns("AA:AG").EntireColumn.Hidden = False Range("A1").Select Sheets("Sheet1").Select Range("A4:A30").Select Selection.Cut Range("C4").Select ActiveSheet.Paste Range("B4:B30").Select Selection.ClearContents Range("C4:M30").Select Selection.Sort Key1:=Range("C4"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal HideRowsWithZeroAHT Range("A3:C3").Select ActiveCell.FormulaR1C1 = "=MAX(R[1]C[2]:R[27]C[2])" Range("B4").Select Range("A1").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please Help: Macro Nearly Finished | Excel Discussion (Misc queries) | |||
Loop until finished | Excel Discussion (Misc queries) | |||
Loop until finished. | Excel Discussion (Misc queries) | |||
vba to loop until process finished | Excel Programming | |||
Know when .cmd has finished | Excel Programming |