![]() |
Runtime error
This is all the code I am trying to get to work, basicalu copy the cells
G9:G15 onto next available row in 'database' worksheet, clear cells G9:G15 and advise the user the job has been 'done' ther code I have.... Sub copydata() Application.ScreenUpdating = False Range("G9:G15").Copy Sheets("database").Select Range("a1").End(xlDown).Select ActiveCell.Offset(1, 1).Range("a1").PasteSpecial _Paste:=xlValues, Transpose:=True Range("A1").Select Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Formula = ActiveCell + 1 Range("A1").Select Sheets("input").Select Range("G9:G15").ClearContents Range("h10").FormulaR1C1 = "done" Range("f28").Font.ColorIndex = 11 Application.CutCopyMode = False Range("f11").Select End Sub and the error I am getting..... Runtime error '1004' Application defined or object defined error Please help as I have no idea what this is all about - I'm the novice !! |
Try something like this --
Dim pTargetRow as long Dim pIndex as long With Sheets("DataBase") pTargetRow = .UsedRange.Row + .UsedRange.Rows.Count For pIndex = 1 to 7 .Cells(pTargetRow, pIndex) = Sheets("Input").Cells(pIndex + 8, 7) Sheets("Input").Cells(pIndex + 8, 7).ClearContents Next MsgBox "Finished" End With "Anthony" wrote in message ... This is all the code I am trying to get to work, basicalu copy the cells G9:G15 onto next available row in 'database' worksheet, clear cells G9:G15 and advise the user the job has been 'done' ther code I have.... Sub copydata() Application.ScreenUpdating = False Range("G9:G15").Copy Sheets("database").Select Range("a1").End(xlDown).Select ActiveCell.Offset(1, 1).Range("a1").PasteSpecial _Paste:=xlValues, Transpose:=True Range("A1").Select Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Formula = ActiveCell + 1 Range("A1").Select Sheets("input").Select Range("G9:G15").ClearContents Range("h10").FormulaR1C1 = "done" Range("f28").Font.ColorIndex = 11 Application.CutCopyMode = False Range("f11").Select End Sub and the error I am getting..... Runtime error '1004' Application defined or object defined error Please help as I have no idea what this is all about - I'm the novice !! |
All times are GMT +1. The time now is 10:22 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com