LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
CB CB is offline
external usenet poster
 
Posts: 97
Default Problems with a Run-time error of 1004....

Hello,

I'm trying to do something I thought was pretty simple, but guess not...

I am trying to copy an area in one file (input file) and then paste those
contents (insert cells) into a master file.

So, in the master file, I need the paste to insert however many lines are in
the buffer....

Anyhow, I'm getting the 1004 error. At work, as long as I am in a certain
cell of the master file, it worked, but at home, this version of Excel
doesn't ever work (2007 I think, it's got the ribbon thing so finding
anything is an extra 30 mins).

I've got to think there's a consistent way to insert the copied cells, but
if not, maybe there's another way to get that data into the master file?

thanks,
Chris

Here's the macro I am working with:



Sub Macro1()

'

'

' Macro1 Macro

' Macro recorded 12/23/2009 by Chris Powers

'

' What this doesn't address:

' 1) selecting file to import

' 2) separating expenses & deposits

' 3) determinng what column an expense should
go in

'

'

' I have this broken into multiple parts, otherwise I'll get a
1004 error every time.

'

' First part, open file, remove top 7 rows, get rid of
unneeded columns, save, close

'

'

'

Workbooks.OpenText Filename:="C:\TEMP\Dec Exp Tracker.TXT", Origin:=437, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(1, 1), _
TrailingMinusNumbers:=True

Rows("1:7").Select

Selection.Delete Shift:=xlUp

Columns("F:F").Select

Selection.Delete Shift:=xlToLeft

Columns("C:D").Select

Selection.Delete Shift:=xlToLeft

'

'

'

'

' Here I try to insert a column so this data lines up with Master file -
this always generates 1004 error.

'

' Range("A1").Select

' ActiveCell.FormulaR1C1 = "delete"

'

'

ActiveWorkbook.Save

ActiveWorkbook.Save

ActiveWorkbook.Close

'

'

' Second part, re-open file I just had open, select data, copy
it

'

' Move back to master file to it's current cell, paste data

'

Workbooks.Open Filename:="C:\TEMP\Dec Exp Tracker.TXT"

Rows("1:1").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

Windows("C & A Tracker.xls(2)").Activate

Selection.Insert Shift:=xlDown

ActiveWindow.SmallScroll Down:=-21

End Sub






 
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
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Problems ReplaceFormat - error 1004 ndsykes Excel Programming 2 March 19th 07 05:16 PM
Run Time Error 1004: Application or Object Defined Error BEEJAY Excel Programming 4 October 18th 06 04:19 PM
Run Time 1004 Error: Application or Object Difine Error BEEJAY Excel Programming 0 October 17th 06 10:45 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM


All times are GMT +1. The time now is 11:30 PM.

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

About Us

"It's about Microsoft Excel"