LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Loop until finished

I need this to loop until it copy and paste the information to all the
required field. How do I do that?

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
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 -------("C15")..and so on.
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop until finished. David A. Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
Formula working backwards from finished price Eqa Excel Discussion (Misc queries) 2 July 2nd 07 08:48 AM
Format size of finished sheet? pippin New Users to Excel 6 July 25th 06 02:31 PM
Any way to loop this in VBA? Bill (Unique as my name) Excel Discussion (Misc queries) 5 February 22nd 06 11:04 PM
msg box with finished time, please read Rowan Excel Worksheet Functions 2 July 2nd 05 02:33 AM


All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"