Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Clear color but not pattern?

I am having issues with the cell color changing and updating, and removing
pattern information in the same cell.

I need to look through a data and color it a certain color and when the data
is revised, I uncolor it. Users have added patterns to denote other stuff and
the remove color as desribed below, also removes the pattern. Is there a way
to remove the color and retain the pattern?

If Cells(x, y).Interior.ColorIndex = 8 Then
Cells(x, y).Interior.ColorIndex = xlNone
End If

Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Clear color but not pattern?

Try this:

If Cells(x, y).Interior.ColorIndex = 8 Then
myPattern = Cells(x,y).Interior.Pattern
Cells(x, y).Interior.ColorIndex = xlNone
Cells(x, y).Interior.Pattern = myPatter
End If

jayklmno wrote:
I am having issues with the cell color changing and updating, and removing
pattern information in the same cell.

I need to look through a data and color it a certain color and when the data
is revised, I uncolor it. Users have added patterns to denote other stuff and
the remove color as desribed below, also removes the pattern. Is there a way
to remove the color and retain the pattern?

If Cells(x, y).Interior.ColorIndex = 8 Then
Cells(x, y).Interior.ColorIndex = xlNone
End If

Thanks,
Jay


  #3   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Clear color but not pattern?

Retain the pattern with a variable and reapply it.
i.e.

Dim myPattern as long

If Cells(x, y).Interior.ColorIndex = 8 Then
myPattern = Cells(x, y).Interior.Pattern
Cells(x, y).Interior.ColorIndex = xlNone
Cells(x, y).Interior.Pattern = myPattern
End If


--
Les Torchia-Wells


"jayklmno" wrote:

I am having issues with the cell color changing and updating, and removing
pattern information in the same cell.

I need to look through a data and color it a certain color and when the data
is revised, I uncolor it. Users have added patterns to denote other stuff and
the remove color as desribed below, also removes the pattern. Is there a way
to remove the color and retain the pattern?

If Cells(x, y).Interior.ColorIndex = 8 Then
Cells(x, y).Interior.ColorIndex = xlNone
End If

Thanks,
Jay

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Clear color but not pattern?

Thanks, Gents!

"John Fuller" wrote:

Try this:

If Cells(x, y).Interior.ColorIndex = 8 Then
myPattern = Cells(x,y).Interior.Pattern
Cells(x, y).Interior.ColorIndex = xlNone
Cells(x, y).Interior.Pattern = myPatter
End If

jayklmno wrote:
I am having issues with the cell color changing and updating, and removing
pattern information in the same cell.

I need to look through a data and color it a certain color and when the data
is revised, I uncolor it. Users have added patterns to denote other stuff and
the remove color as desribed below, also removes the pattern. Is there a way
to remove the color and retain the pattern?

If Cells(x, y).Interior.ColorIndex = 8 Then
Cells(x, y).Interior.ColorIndex = xlNone
End If

Thanks,
Jay



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Clear color but not pattern?

Something like:

With Selection.Interior
sPattern = .Pattern
sPatternIndex = .PatternColorIndex
.ColorIndex = xlNone
.Pattern = sPattern
.PatternColorIndex = sPatternIndex
End With

So:

If Cells(x, y).Interior.ColorIndex = 8 Then
With Cells(x, y).Interior
sPattern = .Pattern
sPatternIndex = .PatternColorIndex
.ColorIndex = xlNone
.Pattern = sPattern
.PatternColorIndex = sPatternIndex
End With
End If

Regards

Trevor


"jayklmno" wrote in message
...
I am having issues with the cell color changing and updating, and removing
pattern information in the same cell.

I need to look through a data and color it a certain color and when the
data
is revised, I uncolor it. Users have added patterns to denote other stuff
and
the remove color as desribed below, also removes the pattern. Is there a
way
to remove the color and retain the pattern?

If Cells(x, y).Interior.ColorIndex = 8 Then
Cells(x, y).Interior.ColorIndex = xlNone
End If

Thanks,
Jay



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
color bar with pattern macro Daniel Charts and Charting in Excel 4 June 28th 07 10:26 PM
cell pattern - color tikchye_oldLearner57 Excel Discussion (Misc queries) 2 April 11th 07 12:28 PM
Pie Chart Color/Pattern cjc Charts and Charting in Excel 1 June 9th 05 04:07 AM
clear pattern not gridlines bob Excel Programming 2 February 10th 04 06:21 AM
clear pattern but not gridlines bob Excel Programming 1 February 10th 04 03:28 AM


All times are GMT +1. The time now is 12:40 AM.

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"