Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Missing something in my code...


I want each cell right to a cell containing "I" in the column B to be
filled with a pattern. What's missing?

(The call of the pattern is also wrong...)


Dim cell As Range
For Each cell In Range("B:B")
If cell = "I" Then *(XXX)*.Offset(0, 1).*Fill.Patterned
msoPattern50Percent*
Next


--
Turquoise_dax
------------------------------------------------------------------------
Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
View this thread: http://www.excelforum.com/showthread...hreadid=554613

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Missing something in my code...

Try (change pattern to suit):

Dim cell As Range
For Each cell In Range("B:B")
If cell = "I" Then
cell.Offset(0, 1).Interior.Pattern = xlGray50
End If
Next

"Turquoise_dax" wrote:


I want each cell right to a cell containing "I" in the column B to be
filled with a pattern. What's missing?

(The call of the pattern is also wrong...)


Dim cell As Range
For Each cell In Range("B:B")
If cell = "I" Then *(XXX)*.Offset(0, 1).*Fill.Patterned
msoPattern50Percent*
Next


--
Turquoise_dax
------------------------------------------------------------------------
Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
View this thread: http://www.excelforum.com/showthread...hreadid=554613


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Missing something in my code...

On Thu, 22 Jun 2006 10:34:16 -0500, Turquoise_dax wrote:

I want each cell right to a cell containing "I" in the column B to be
filled with a pattern. What's missing?

(The call of the pattern is also wrong...)


Dim cell As Range
For Each cell In Range("B:B")
If cell = "I" Then *(XXX)*.Offset(0, 1).*Fill.Patterned
msoPattern50Percent*
Next


Consider conditional formatting.

If CF is not suitable for you (because, let's say, you have REALLY huge
amounts of data and REALLY slow computer), use:

If cell.Value = "I" Then cell.Offset(0, 1).Interior.Pattern=xlGray50

--
PL
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Missing something in my code...

This might work for you:

Columns("B").Select
Selection.AutoFilter Field:=1, Criteria1:="=I", Operator:=xlAnd
Columns("C").Select
Selection.Interior.Pattern = xlGray50

Jim


"Turquoise_dax" wrote:


I want each cell right to a cell containing "I" in the column B to be
filled with a pattern. What's missing?

(The call of the pattern is also wrong...)


Dim cell As Range
For Each cell In Range("B:B")
If cell = "I" Then *(XXX)*.Offset(0, 1).*Fill.Patterned
msoPattern50Percent*
Next


--
Turquoise_dax
------------------------------------------------------------------------
Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
View this thread: http://www.excelforum.com/showthread...hreadid=554613


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
Macro - Code Missing Shane Excel Discussion (Misc queries) 4 August 4th 09 08:53 AM
VB code gone missing Ian[_17_] Excel Programming 0 November 26th 05 11:57 AM
code to fill in missing border lines Jack Sons Excel Discussion (Misc queries) 3 November 3rd 05 10:06 PM
Missing dll to work with Ron de Bruin's code a Excel Programming 0 February 19th 05 03:49 PM
Solver code does not save results to sheet - What am I missing?! Simon Livings Excel Programming 0 January 16th 04 03:55 PM


All times are GMT +1. The time now is 04:43 AM.

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"