#1   Report Post  
Anthony
 
Posts: n/a
Default 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   Report Post  
Jezebel
 
Posts: n/a
Default

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
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
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
runtime error '6' overflow don Setting up and Configuration of Excel 1 July 26th 05 02:52 AM
runtime error '800a9c64' Dimple Wathen Excel Discussion (Misc queries) 0 July 14th 05 07:29 PM
Help: runtime error - Method seriescollection object_chart failed huangx06 Charts and Charting in Excel 3 July 9th 05 12:27 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 10:54 AM.

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

About Us

"It's about Microsoft Excel"