Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Error, Excel 2000 & 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jfcby - 29 Jan 2008 14:57 GMT
Hello,

My worksheet has 3 columns and 493 rows of data. For example

         COL 2       COL3    COL4
Row1 0840600     2219      text
Row2 0840625     1345      text

I want COL2 - COL4 bold and interior color 15 (grey) if the number in
COL2 is between 0804600-0804663.

Why am I getting this this error "Method range of global object
failed"

at this line of code "Range("cell.Address(0, 0):cell.offset(,
2).Address(0, 0)").Font.Bold = True"?

Sub FindAddData3()
'
'>> Define Variables
Dim cell As Variant
 '>> Set Variables
 For Each cell In Range("B4:B494") 'Change Range Reference
  '
  If cell.Text >= 804600 Or cell.Text <= 804663 Then
   '
   Range("cell.Address(0, 0):cell.offset(, 2).Address(0,
0)").Font.Bold = True
   Range("cell.Address(0, 0):cell.offset(, 2).Address(0,
0)").Interior.ColorIndex = 15

  Else
   'Do NOTHING
  End If
Next cell
End Sub

Thank you for your help,
jfcby
Nigel - 29 Jan 2008 15:20 GMT
Fixed this and few other things.....
Set cell to type range; use And connector in the logical test; change range
assignment ......

Sub FindAddData3()
'
'>> Define Variables
Dim cell As Range
 '>> Set Variables
 For Each cell In Range("B4:B494") 'Change Range Reference
  '
  If cell.Text >= 804600 And cell.Text <= 804663 Then
   '
   With Range(Cells(cell.Row, 2), Cells(cell.Row, 4))
      .Font.Bold = True
      .Interior.ColorIndex = 15
   End With

  End If
Next cell
End Sub

Signature

Regards,
Nigel
nigelnospam@9sw.co.uk

> Hello,
>
[quoted text clipped - 35 lines]
> Thank you for your help,
> jfcby
James F Cooper - 29 Jan 2008 15:44 GMT
Thanks Nigel, Works great!

> Fixed this and few other things.....
> Set cell to type range; use And connector in the logical test; change
[quoted text clipped - 57 lines]
>> Thank you for your help,
>> jfcby
RickM - 29 Jan 2008 20:54 GMT
I have what I hope is a simple question.
I've been using Excel 2003 on my new laptop since September with no
problems. Yesterday I started to have a problem. No matter what file I opened
or even after rebooting computer, once I start to use the program the + icon
replaces the normal I icon. All I can do is expand a contract ranges from the
cell I was in. I can't get rid of the + icon no matter what I do. I end up
frustrated and leaving Excel.
Any ideas?
Signature

Rick

> Hello,
>
[quoted text clipped - 35 lines]
> Thank you for your help,
> jfcby
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.