Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default changing properties of offset cells

Hi,

Instead of using the code below, is there a way of setting the
colorindex of offset(0,0) to offset(,4)?

Err.Offset(0, 0).Interior.ColorIndex = 3
Err.Offset(0, 1).Interior.ColorIndex = 3
Err.Offset(0, 2).Interior.ColorIndex = 3
Err.Offset(0, 3).Interior.ColorIndex = 3
Err.Offset(0, 4).Interior.ColorIndex = 3

kind regards,
Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default changing properties of offset cells

I think this does the same as you code:

Err.Resize(1, 5).Interior.ColorIndex = 3

--
HTH :)
Dana DeLouis


"MJKelly" wrote in message ...

Hi,

Instead of using the code below, is there a way of setting the
colorindex of offset(0,0) to offset(,4)?

Err.Offset(0, 0).Interior.ColorIndex = 3
Err.Offset(0, 1).Interior.ColorIndex = 3
Err.Offset(0, 2).Interior.ColorIndex = 3
Err.Offset(0, 3).Interior.ColorIndex = 3
Err.Offset(0, 4).Interior.ColorIndex = 3

kind regards,
Matt
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default changing properties of offset cells

Yes it works, thanks very much.

Matt
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default changing properties of offset cells

You may want to avoid using err as your range variable name. Excel's VBA
already has an Err object.

MJKelly wrote:

Hi,

Instead of using the code below, is there a way of setting the
colorindex of offset(0,0) to offset(,4)?

Err.Offset(0, 0).Interior.ColorIndex = 3
Err.Offset(0, 1).Interior.ColorIndex = 3
Err.Offset(0, 2).Interior.ColorIndex = 3
Err.Offset(0, 3).Interior.ColorIndex = 3
Err.Offset(0, 4).Interior.ColorIndex = 3

kind regards,
Matt


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default changing properties of offset cells

Thanks Dave, I'll bear that in mind.

kind regards,
Matt
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
Changing Autoshape properties using formulas only Chris Excel Discussion (Misc queries) 0 September 7th 08 08:07 AM
Can't Paste after Changing Cell Properties [email protected] Excel Programming 0 August 1st 07 09:48 AM
Changing combobox properties leonidas[_13_] Excel Programming 0 June 20th 06 06:57 PM
Cell changing it's properties jtpeters New Users to Excel 0 December 27th 05 10:09 PM
Properties transferring from excel cells to word file properties lubo Excel Programming 4 July 12th 05 11:24 AM


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