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: 121
Default Method Range of Object Failed, Excel 2000 & 2003

Hello,

With the following macro code (a work in progress) I'm getting this
error massage: "Method Range of Object Failed" at the following line:
"MsgBox Range(Cr)".

What part of this macro needs to be modified so that I don not get
this error message?

Sub WorkSheetPageSetup()
'Setup WorkSheet PAGE for Zones
'1. Fill ColumnB with color Light Grey - value 001
'2. or Fill ColumnD with color Light Grey - value Left("BLDG")
Dim LastRow As Long
Dim i As Integer
Dim Cr As String
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Application.ScreenUpdating = False
For i = 5 To Worksheets.Count
For Each cell In Range("A4:A" & LastRow)
If cell.Offset(, 1).Value = "001" Or Left(cell.Offset(,
3).Value, 4) = "BLDG" Then
Ca = cell.Address
Coa = cell.Offset(, 6).Address
Cr = Chr(34) & Mid(Ca, 2, 1) & Right(Ca, 1) & ":" & Mid(Coa,
2, 1) & Right(Coa, 1) & Chr(34)
MsgBox ActiveWorkbook.Name
MsgBox Chr(34) & Mid(Ca, 2, 1) & Right(Ca, 1) & ":" & Mid(Coa,
2, 1) & Right(Coa, 1) & Chr(34)
MsgBox Range(Cr)
End If
Next cell
Next i
Application.ScreenUpdating = True
End Sub

Thank you for your help,
jfcby

 
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
Method Range of object '_Global' failed maverick2005 Excel Programming 3 August 25th 05 02:56 PM
What does XLS VB Method 'Range of object' _Global failed mean? DCMKGG Excel Programming 2 February 25th 05 03:06 PM
Method 'Range' of object '_Global' failed Brian Morris[_2_] Excel Programming 1 December 10th 03 11:04 PM
Excel 97 - Clear Method Of Range Object Failed Dave Peterson[_3_] Excel Programming 2 September 26th 03 01:56 AM
Method 'Range' of object '_Global' failed Mohanasundaram[_2_] Excel Programming 1 August 25th 03 01:43 PM


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