PC Review


Reply
Thread Tools Rate Thread

Control Box assigned to multiple spreadsheets

 
 
LUKEMUDGE
Guest
Posts: n/a
 
      12th May 2009
I have the VB script to change the background color of my cells working but I
would like it to change another cell in a different worksheet. Can anybody
help me out with how to program the reference?

Here is the VB script I'm using to change the colors at the moment

Range("C5").Interior.ColorIndex = -4138 - Range("C5").Interior.ColorIndex
 
Reply With Quote
 
 
 
 
paul.robinson@it-tallaght.ie
Guest
Posts: n/a
 
      13th May 2009
Hi
With Worksheets("MyOtherSheet")
.Range("C5").Interior.ColorIndex = -4138 - .Range
("C5").Interior.ColorIndex
End with

note the period in front of both Range.
If you want to do it on all sheets

Dim ws as worksheet
For each ws in Activeworkbook.Worksheets
With ws
.Range("C5").Interior.ColorIndex = -4138 - .Range
("C5").Interior.ColorIndex
End with

regards
Paul


On May 12, 11:26*pm, LUKEMUDGE <LUKEMU...@discussions.microsoft.com>
wrote:
> I have the VB script to change the background color of my cells working but I
> would like it to change another cell in a different worksheet. Can anybody
> help me out with how to program the reference?
>
> Here is the VB script I'm using to change the colors at the moment
>
> Range("C5").Interior.ColorIndex = -4138 - Range("C5").Interior.ColorIndex


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
feeding a SQLDataSource embedded in an .ascx user control a custom property assigned to that control Microsoft ASP .NET 4 16th Jul 2006 01:20 PM
Frontpage 2003 - Multiple Spreadsheets, Multiple Users, Same forma =?Utf-8?B?RnJvbnRwYWdlIDIwMDMgLSBNdWx0aXBsZSBTcHJl Microsoft Frontpage 1 23rd Aug 2005 12:13 PM
How to update multiple links in multiple spreadsheets followin mo. =?Utf-8?B?QW5keQ==?= Microsoft Excel Worksheet Functions 0 20th Jan 2005 04:51 PM
how to get inside Active X control the control ID assigned by userat dialog template =?Utf-8?B?eXR2?= Microsoft VC .NET 0 28th May 2004 01:41 AM
Multiple IP's assigned to one PC Jon Windows XP Networking 2 27th Oct 2003 09:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:29 AM.