View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
efface
 
Posts: n/a
Default Macro copy and paste = blank worksheet


I'm creating a macro and it's not functioning the same once I use it.

I first sort a column by a number range, click the top left corner,
copy the data, insert a new sheet, and then i paste it. While I create
the macro everything is fine. But when I use the macro, it does
everything I told it, it copies the header but none of the data, it's
completely blank. Does anyone know what i am doing wrong? Here is the
VMB code


Code:
--------------------
Sheets("Weekly Non-Responder Tech").Select
Selection.AutoFilter Field:=3, Criteria1:="SANFRANCISCO-OAKLAND-SANJOSE_CA"
Columns("D:D").Select
Range("D2").Activate
Selection.AutoFilter Field:=4, Criteria1:="=2509", Operator:=xlAnd, _
Criteria2:="<=2688"
Range("A1:K823").Sort Key1:=Range("D1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Cells.Select
Selection.Copy
Sheets("Weekly Non-Responder Tech").Select
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "In House"
Cells.Select
ActiveSheet.Paste
Sheets("Weekly Non-Responder Tech").Select
Range("D1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "IR_TECH"
With ActiveCell.Characters(Start:=1, Length:=7).Font
.Name = "MS Sans Serif"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("D67").Select
End Sub
--------------------


--
efface
------------------------------------------------------------------------
efface's Profile: http://www.excelforum.com/member.php...o&userid=33882
View this thread: http://www.excelforum.com/showthread...hreadid=536596