LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Run-time error 1004

Hi,

I'm working on a program and have received the following error message when I
try to run it.

"Run-time error 104
Application-defined or object-defined error"

I am trying to use a counter to transfer cell data from sheet 1 to sheet 2.
For example, I have data in the first five rows in column A. I want to, say,
transter the data from the last four rows in Col A to sheet 2. But I will do
it according which cell is made active based on a "counter" value. Right now
I am only writing part of that part of the program. Here is my code:

Sub MySub()
'Transfer sheet data according to i
Dim Total As Double
Dim i As Integer
i = 1
Total = 1
For i = 1 To 3
Total = Total + i
Fred
Next i
End Sub

Sub Fred()

Worksheets("Sheet2").Cells(Total, 1).Value = Worksheets("Sheet1").Cells(Total,
1).Value

End Sub



For example, when the counter is 2 the value in cell (2,1) in sheet 1 is placed
in cell (2,1) on sheet 2. When the counter is 4, the value in cell (4,1) in
sheet 1 is placed in cell (4,1). Hope this is clear. Can anyone tell me what
I am doing wrong and what I can do to fix it?

Thanks


 
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 Louise Excel Worksheet Functions 0 January 18th 07 08:16 PM
Run-Time error '1004' [email protected] Excel Discussion (Misc queries) 3 March 29th 06 08:13 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Run-Time Error 1004 George Nicholson[_2_] Excel Programming 0 July 27th 04 09:49 PM
Run Time Error 1004 Lars Kofod Excel Programming 1 December 5th 03 02:56 AM


All times are GMT +1. The time now is 05:11 AM.

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"