Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 !! |
#2
|
|||
|
|||
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 !! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
runtime error '6' overflow | Setting up and Configuration of Excel | |||
runtime error '800a9c64' | Excel Discussion (Misc queries) | |||
Help: runtime error - Method seriescollection object_chart failed | Charts and Charting in Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |