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: 22
Default error: ActiveCell.Offset(0, -1).Select = Application-defined or object-defined error

Why do I keep getting 1004 error when trying to move active cell ?? :

For a = 1 To 6000
If ActiveCell = "F" Then 'Sortering for kvinder og 20-39 år

ActiveCell.Offset(0, -1).Select ' Flyt activ celle til alder

If ActiveCell = 20 And ActiveCell = 39 Then

ActiveCell.Offset(0, 12).Select ' Flyt activ celle til fedtprocent

If ActiveCell < 21 Then
myCount = Sheets("Fedtprocent").Range("C12") + 1
Sheets("Fedtprocent").Range("C12") = myCount
End If

If ActiveCell = 21 And ActiveCell < 33 Then
myCount = Sheets("Fedtprocent").Range("C13") + 1
Sheets("Fedtprocent").Range("C13") = myCount
End If

If ActiveCell = 33 And ActiveCell < 39 Then
myCount = Sheets("Fedtprocent").Range("C14") + 1
Sheets("Fedtprocent").Range("C14") = myCount
End If

If ActiveCell = 39 Then
myCount = Sheets("Fedtprocent").Range("C15") + 1
Sheets("Fedtprocent").Range("C15") = myCount
End If

End If

End If

If ActiveCell.Value = "" Then 'End macro ved tom celle
Sheets("Fedtprocent").Select
Range("L2").Select
Application.ScreenUpdating = True
End
End If

ActiveCell.Offset(1, -11).Select ' Flyt celle ned. Fedtprocent celle er
valgt <------------ERROR !

Next a


Regards Shamran


 
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
Macro error : Application-defined or object-defined error Joe Excel Discussion (Misc queries) 3 January 27th 06 02:32 PM
Error 1004 Application Defined or Object Defined Error Garry[_6_] Excel Programming 2 October 1st 04 10:33 AM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM


All times are GMT +1. The time now is 12:07 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"