Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Format Row Conditionally

I have a spreadsheet that changes from month-to-month. I have a Macro that
does different formatting and I wanted to do something odd. Column J has
nearly all dates, however, periodically there is text. Either "Billing: #" or
"Complete: #". If "Billing" or "Complete" shows up I want that entire row to
be formatted differently. The default format is center, if this text appears
I want the format to be, ".HorizontalAlignment = xlGeneral" and
".VerticalAlignment = xlTop".

Does this makes sense? Is it possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default Format Row Conditionally

Quick code that I didn't try. You would need to add this in your formatting
macro.

with activesheet.range("J1").entirecolumn.specialcells( xlCellTypeConstants, 2)
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
end with

This is not really efficient code but it gives you an idea. For this to
work, you need to have all your data in the sheet. To have this work like
conditional formatting, you need to write your in code in the worksheet
change event.

p-a

"FrankM" wrote:

I have a spreadsheet that changes from month-to-month. I have a Macro that
does different formatting and I wanted to do something odd. Column J has
nearly all dates, however, periodically there is text. Either "Billing: #" or
"Complete: #". If "Billing" or "Complete" shows up I want that entire row to
be formatted differently. The default format is center, if this text appears
I want the format to be, ".HorizontalAlignment = xlGeneral" and
".VerticalAlignment = xlTop".

Does this makes sense? Is it possible?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Format Row Conditionally

That is very close. it formats the column but what I want to format is the
row. I want to scan down column J and when Billing or Complete shows up in
the column, I want the entire row that Billing or Complete shows up in to be
formatted.

"PA" wrote:

Quick code that I didn't try. You would need to add this in your formatting
macro.

with activesheet.range("J1").entirecolumn.specialcells( xlCellTypeConstants, 2)
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
end with

This is not really efficient code but it gives you an idea. For this to
work, you need to have all your data in the sheet. To have this work like
conditional formatting, you need to write your in code in the worksheet
change event.

p-a

"FrankM" wrote:

I have a spreadsheet that changes from month-to-month. I have a Macro that
does different formatting and I wanted to do something odd. Column J has
nearly all dates, however, periodically there is text. Either "Billing: #" or
"Complete: #". If "Billing" or "Complete" shows up I want that entire row to
be formatted differently. The default format is center, if this text appears
I want the format to be, ".HorizontalAlignment = xlGeneral" and
".VerticalAlignment = xlTop".

Does this makes sense? Is it possible?

  #4   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default Format Row Conditionally

Your right. Add

..EntireRow

at the end:

With ActiveSheet.Range("J1").EntireColumn.SpecialCells( xlCellTypeConstants,
2).EntireRow
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
End With

"FrankM" wrote:

That is very close. it formats the column but what I want to format is the
row. I want to scan down column J and when Billing or Complete shows up in
the column, I want the entire row that Billing or Complete shows up in to be
formatted.

"PA" wrote:

Quick code that I didn't try. You would need to add this in your formatting
macro.

with activesheet.range("J1").entirecolumn.specialcells( xlCellTypeConstants, 2)
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
end with

This is not really efficient code but it gives you an idea. For this to
work, you need to have all your data in the sheet. To have this work like
conditional formatting, you need to write your in code in the worksheet
change event.

p-a

"FrankM" wrote:

I have a spreadsheet that changes from month-to-month. I have a Macro that
does different formatting and I wanted to do something odd. Column J has
nearly all dates, however, periodically there is text. Either "Billing: #" or
"Complete: #". If "Billing" or "Complete" shows up I want that entire row to
be formatted differently. The default format is center, if this text appears
I want the format to be, ".HorizontalAlignment = xlGeneral" and
".VerticalAlignment = xlTop".

Does this makes sense? Is it possible?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Format Row Conditionally

Thank you. It worked perfectly. I am very grateful.

"PA" wrote:

Your right. Add

.EntireRow

at the end:

With ActiveSheet.Range("J1").EntireColumn.SpecialCells( xlCellTypeConstants,
2).EntireRow
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
End With

"FrankM" wrote:

That is very close. it formats the column but what I want to format is the
row. I want to scan down column J and when Billing or Complete shows up in
the column, I want the entire row that Billing or Complete shows up in to be
formatted.

"PA" wrote:

Quick code that I didn't try. You would need to add this in your formatting
macro.

with activesheet.range("J1").entirecolumn.specialcells( xlCellTypeConstants, 2)
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
end with

This is not really efficient code but it gives you an idea. For this to
work, you need to have all your data in the sheet. To have this work like
conditional formatting, you need to write your in code in the worksheet
change event.

p-a

"FrankM" wrote:

I have a spreadsheet that changes from month-to-month. I have a Macro that
does different formatting and I wanted to do something odd. Column J has
nearly all dates, however, periodically there is text. Either "Billing: #" or
"Complete: #". If "Billing" or "Complete" shows up I want that entire row to
be formatted differently. The default format is center, if this text appears
I want the format to be, ".HorizontalAlignment = xlGeneral" and
".VerticalAlignment = xlTop".

Does this makes sense? Is it possible?

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
conditionally format anumber format Montana Excel Worksheet Functions 5 January 15th 08 05:25 PM
How do I conditionally format a chart? Midavalo Charts and Charting in Excel 1 February 21st 06 10:10 AM
Conditionally format row height CDAK Excel Programming 3 June 8th 05 09:31 PM
How do I conditionally format a chart? Michelle Excel Discussion (Misc queries) 1 April 12th 05 09:59 PM
Conditionally format Terri Excel Programming 1 November 15th 04 08:06 PM


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