Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick! Help With Code Formatting!

I have the following code:

Range("J9:O39").Select
Selection.Interior.ColorIndex = 35

When users say go to cell J9 and highlight the cell RED, then when
run my macro, i'd like it to skip the formatting that the user inputte
and just change the color for the remaining cells in the range...

Any ideas??

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Quick! Help With Code Formatting!

"alexm999 " wrote:

I have the following code:

Range("J9:O39").Select
Selection.Interior.ColorIndex = 35

When users say go to cell J9 and highlight the cell RED, then when I
run my macro, i'd like it to skip the formatting that the user inputted
and just change the color for the remaining cells in the range...

I'm assuming you want to change any cell that have not been changed already (rather than not changing only RED cells)

Sub test()
Dim Cell As Range
Range("J9:O39").Select
For Each Cell In Selection
If Cell.Interior.ColorIndex = xlNone Then Cell.Interior.ColorIndex = 35
Next Cell
End Sub
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
Quick Code Nimish Excel Discussion (Misc queries) 3 September 11th 06 07:19 PM
quick code request michelle Excel Programming 1 June 23rd 04 09:59 AM
quick code question dave!! Excel Programming 2 May 18th 04 04:56 PM
Quick VBA code question (if...then statement) abxy[_31_] Excel Programming 4 February 26th 04 01:04 AM
Is there a quick way to see which objects have code attached? Terri[_4_] Excel Programming 2 September 12th 03 05:11 PM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"