Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help with the following code...from EntireRow to set width

I have this code to format the entire row a certain color depending on
the text in Column "I". However, I really just want it to go from
column "A" to column "J".

What would I substitute for ".EntireRow"?

'------------------------------------------
Sub ConditionalFormatter()

[I2].Activate
With Range([I2], [I65536].End(xlUp)).EntireRow
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""N"""
.FormatConditions(1).Interior.ColorIndex = 10
.FormatConditions(1).Font.ColorIndex = 2
.FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""X"""
.FormatConditions(2).Interior.ColorIndex = 19
.FormatConditions(2).Font.ColorIndex = 1
End With

End Sub
'------------------------------------------

Thanks, Todd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Help with the following code...from EntireRow to set width

Todd,

With Range([I2], [I65536].End(xlUp)).Offset(0, -8).Resize(, 10)

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"bentod"
wrote in message
I have this code to format the entire row a certain color depending on
the text in Column "I". However, I really just want it to go from
column "A" to column "J".
What would I substitute for ".EntireRow"?
'------------------------------------------
Sub ConditionalFormatter()

[I2].Activate
With Range([I2], [I65536].End(xlUp)).EntireRow
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""N"""
.FormatConditions(1).Interior.ColorIndex = 10
.FormatConditions(1).Font.ColorIndex = 2
.FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""X"""
.FormatConditions(2).Interior.ColorIndex = 19
.FormatConditions(2).Font.ColorIndex = 1
End With

End Sub
'------------------------------------------
Thanks, Todd
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help with the following code...from EntireRow to set width

On Jan 16, 8:35*am, "Jim Cone" wrote:
Todd,

* *With Range([I2], [I65536].End(xlUp)).Offset(0, -8).Resize(, 10)

Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"bentod"
wrote in message
I have this code to format the entire row a certain color depending on
the text in Column "I". *However, I really just want it to go from
column "A" to column "J".
What would I substitute for ".EntireRow"?
'------------------------------------------
Sub ConditionalFormatter()

[I2].Activate
* * With Range([I2], [I65536].End(xlUp)).EntireRow
* * * * .FormatConditions.Delete
* * * * .FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""N"""
* * * * .FormatConditions(1).Interior.ColorIndex = 10
* * * * .FormatConditions(1).Font.ColorIndex = 2
* * * * .FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""X"""
* * * * .FormatConditions(2).Interior.ColorIndex = 19
* * * * .FormatConditions(2).Font.ColorIndex = 1
* * End With

End Sub
'------------------------------------------
Thanks, Todd


I think I see what you were going for: count back 8 to column "A",
then add columns up to "J".

However, it yeilded no noticeable results.

Todd
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help with the following code...from EntireRow to set width

It might help if I removed the conditional formatting before starting.


On Jan 16, 8:35*am, "Jim Cone" wrote:
Todd,

* *With Range([I2], [I65536].End(xlUp)).Offset(0, -8).Resize(, 10)

Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

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
Change every 3 columns width with code Les Stout[_2_] Excel Programming 11 August 2nd 07 04:35 AM
Dropdown list width changing code XXL User Excel Worksheet Functions 1 June 26th 06 09:11 PM
ActiveWindow.VisibleRange.Width - Is this the correct code StevenS Excel Programming 1 October 15th 05 06:34 AM
adding code to shrink columns to reasonable width Todd F.[_2_] Excel Programming 2 July 25th 05 06:48 PM
Using Code to Adjust Specific Column Width Nigel Bennett Excel Programming 4 March 9th 05 06:11 AM


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