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


hey i get the following error:

Run-time error '1004':

Method 'Range' of object '_Global' failed


when i try execute the following macro:


Code:
--------------------
Sub Macro_ContractTermination()
Dim c As Range


For Each c In Range(AcitiveCell, Cells(370, ActiveCell.Column))
If c.Interior.ColorIndex = 2 Or c.Interior.ColorIndex < 0 And Len(c) = 0 And c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 56
End If

Next c

End Sub
--------------------


Can anyone work out whats going wrong, or maybe i've typed the macro
incorrectly. what it is ment to do is the user chooses a start cell
and then when its executed every cell in the chossen column up to cell
370 changes colour, but its only the blank white cells that change.


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=477442

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default run-time error 1004


Hello alymcmorland,

If you want to change the color of all the cells regardless of curren
color or content, this code will do that for you

Dim Addx As String
Dim Col As Long
Dim Row As Long

Row = ActiveCell.Row
Col = ActiveCell.Column

Addx = Cells(Row, Col).Address & ":" & Cells(370, Col).Address
ActiveSheet.Range(Addx).Interior.ColorIndex = 56


Sincerely,
Leith ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=47744

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default run-time error 1004

There is a typo in this line: AcitiveCell instead of ActiveCell

For Each c In Range(AcitiveCell, Cells(370, ActiveCell.Column))


Regards,
Stefi

€žalymcmorland€ť ezt Ă*rta:


hey i get the following error:

Run-time error '1004':

Method 'Range' of object '_Global' failed


when i try execute the following macro:


Code:
--------------------
Sub Macro_ContractTermination()
Dim c As Range


For Each c In Range(AcitiveCell, Cells(370, ActiveCell.Column))
If c.Interior.ColorIndex = 2 Or c.Interior.ColorIndex < 0 And Len(c) = 0 And c.FormulaR1C1 = "" Then
c.Interior.ColorIndex = 56
End If

Next c

End Sub
--------------------


Can anyone work out whats going wrong, or maybe i've typed the macro
incorrectly. what it is ment to do is the user chooses a start cell
and then when its executed every cell in the chossen column up to cell
370 changes colour, but its only the blank white cells that change.


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=477442


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default run-time error 1004


Well its only blank white cells that i need to change, if they have
value in there or are a different colour then i don't want it t
change!

But thank you for the feedback anywa

--
alymcmorlan
-----------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...fo&userid=2765
View this thread: http://www.excelforum.com/showthread.php?threadid=47744

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
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Run time error '1004': Generaol ODBC error Dwaine Horton[_3_] Excel Programming 2 April 26th 05 02:52 PM
Run time error 1004 General ODCB Error Kevin Excel Programming 3 February 26th 05 12:51 PM
Application Run Time Error 1004 and Stack Error ExcelMonkey[_190_] Excel Programming 9 February 11th 05 04:48 PM


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