Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveSheet.Paste error in XP
I've got a macro which works perfectly in Windows 2000 with Excel 2000 but
falls over in Windows XP Pro with Excel 2003. It fails on ActiveSheet.Paste with an error message Run Time Error 1004 - Application defined or object defined error. Any ideas would be much appreciated Thanks The full code is: Sheets("Data").Select Range("A1:AJ15000").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("AP1:AP2"), Unique:=False Range("A1").Select Range("A2:A15000,C2:C15000,E2:E15000,F2:f15000,G2: g15000,H2:h15000,I2:I15000").Select Selection.Copy Sheets("Signup Report").Select Range("A2").Select ActiveSheet.Paste Sheets("Data").Select Range("J2: J15000 , L2: L15000 , M2: M15000 , AG2: AG15000 , AI2: AI15000 , O2: o15000 ").Select Selection.Copy Sheets("Signup Report").Select Range("I2").Select ActiveSheet.Paste Dim frng As Range Application.CutCopyMode = False Range("H2").FormulaR1C1 = "=RC6+90" Set frng = Range("h2:h" & Range("f65536").End(xlUp).Row) frng.FillDown Range("o2").FormulaR1C1 = "=Sum(RC11:RC14)" Range("p2").FormulaR1C1 = "=ROUND(RC15*25%,2)" Set frng = Range("o2:p" & Range("f65536").End(xlUp).Row) frng.FillDown Columns("j:p").Select Selection.NumberFormat = "0.00" Columns("e:i").Select Selection.NumberFormat = "dd/mm/yyyy" Columns("a:d").Select Selection.Columns.AutoFit Columns("e:p").Select Selection.ColumnWidth = 11.5 Application.Calculation = xlCalculationAutomatic Selection.Copy Selection.PasteSpecial Paste:=xlValues Application.CutCopyMode = False Range("a1").Select end sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveSheet.Paste error in XP
Sub AABBCC()
Dim shData As Worksheet Dim shSign As Worksheet Dim fRng As Range Set shData = Sheets("Data") Set shSign = Sheets("Signup Report") shData.Range("A1:AJ15000").AdvancedFilter _ Action:=xlFilterInPlace, _ CriteriaRange:= _ shData.Range("AP1:AP2"), Unique:=False sh.DataRange("A2:A15000,C2:C15000,E2:E15000," _ & "F2:f15000,G2:g15000,H2:h15000,I2:I15000").Cop y _ Destination:=shSign.Range("A2") sh.Data.Range("J2: J15000,L2:L15000,M2:M15000" & _ ",AG2:AG15000,AI2:AI15000,O2:O15000 ").Copy _ Destination:=shSign.Range("I2") Application.CutCopyMode = False sh.Sign.Range("H2").FormulaR1C1 = "=RC6+90" Set fRng = shSign.Range("h2:h" & _ sh.Sign.Range("f65536").End(xlUp).Row) fRng.FillDown shSign.Range("o2").FormulaR1C1 = "=Sum(RC11:RC14)" shSign.Range("p2").FormulaR1C1 = "=ROUND(RC15*25%,2)" Set fRng = shSign.Range("o2:p" & _ shSign.Range("f65536").End(xlUp).Row) fRng.FillDown With shSign .Columns("j:p").NumberFormat = "0.00" .Columns("e:i").NumberFormat = "dd/mm/yyyy" .Columns("a:d").Columns.AutoFit Application.Calculation = xlCalculationAutomatic With .Columns("e:p").ColumnWidth = 11.5 .Copy .PasteSpecial Paste:=xlValues End With Application.CutCopyMode = False End With End Sub Might work. -- Regards, Tom Ogilvy "nospaminlich" wrote in message ... I've got a macro which works perfectly in Windows 2000 with Excel 2000 but falls over in Windows XP Pro with Excel 2003. It fails on ActiveSheet.Paste with an error message Run Time Error 1004 - Application defined or object defined error. Any ideas would be much appreciated Thanks The full code is: Sheets("Data").Select Range("A1:AJ15000").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("AP1:AP2"), Unique:=False Range("A1").Select Range("A2:A15000,C2:C15000,E2:E15000,F2:f15000,G2: g15000,H2:h15000,I2:I15000 ").Select Selection.Copy Sheets("Signup Report").Select Range("A2").Select ActiveSheet.Paste Sheets("Data").Select Range("J2: J15000 , L2: L15000 , M2: M15000 , AG2: AG15000 , AI2: AI15000 , O2: o15000 ").Select Selection.Copy Sheets("Signup Report").Select Range("I2").Select ActiveSheet.Paste Dim frng As Range Application.CutCopyMode = False Range("H2").FormulaR1C1 = "=RC6+90" Set frng = Range("h2:h" & Range("f65536").End(xlUp).Row) frng.FillDown Range("o2").FormulaR1C1 = "=Sum(RC11:RC14)" Range("p2").FormulaR1C1 = "=ROUND(RC15*25%,2)" Set frng = Range("o2:p" & Range("f65536").End(xlUp).Row) frng.FillDown Columns("j:p").Select Selection.NumberFormat = "0.00" Columns("e:i").Select Selection.NumberFormat = "dd/mm/yyyy" Columns("a:d").Select Selection.Columns.AutoFit Columns("e:p").Select Selection.ColumnWidth = 11.5 Application.Calculation = xlCalculationAutomatic Selection.Copy Selection.PasteSpecial Paste:=xlValues Application.CutCopyMode = False Range("a1").Select end sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ActiveSheet.Paste (error) | Excel Worksheet Functions | |||
ActiveSheet.Paste - Error help? | Excel Discussion (Misc queries) | |||
XP activesheet.paste error on VMware servers | Excel Programming | |||
ActiveSheet.Paste error | Excel Programming |