ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to edit row height with conditional formatting? (https://www.excelbanter.com/excel-discussion-misc-queries/29612-how-edit-row-height-conditional-formatting.html)

CDAK

How to edit row height with conditional formatting?
 
I want to edit row height with conditional formatting. I have a query behind
my spreadsheet and there are 3 types of products it returns (X, Y, Z). When
it returns a Z product (product is a column heading), I want the row height
to be much smaller than if it returns a X or Y product. Does anyone know how
this can be done? Thanks.

Nick Hodge

Cannot be done without code

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"CDAK" wrote in message
...
I want to edit row height with conditional formatting. I have a query
behind
my spreadsheet and there are 3 types of products it returns (X, Y, Z).
When
it returns a Z product (product is a column heading), I want the row
height
to be much smaller than if it returns a X or Y product. Does anyone know
how
this can be done? Thanks.




JE McGimpsey

not with Conditional Formatting. It could probably be done with a VBA
event macro.

In article ,
"CDAK" wrote:

I want to edit row height with conditional formatting. I have a query behind
my spreadsheet and there are 3 types of products it returns (X, Y, Z). When
it returns a Z product (product is a column heading), I want the row height
to be much smaller than if it returns a X or Y product. Does anyone know how
this can be done? Thanks.


CDAK

Is this code complicated or is it a simple sub? I've used VB a little bit in
the past but never with Excel so I don't really know where to begin. Can you
give me a little help with the code if you have the time?

"Nick Hodge" wrote:

Cannot be done without code

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"CDAK" wrote in message
...
I want to edit row height with conditional formatting. I have a query
behind
my spreadsheet and there are 3 types of products it returns (X, Y, Z).
When
it returns a Z product (product is a column heading), I want the row
height
to be much smaller than if it returns a X or Y product. Does anyone know
how
this can be done? Thanks.





Nick Hodge

You would need to use Worksheet_Change() event code. The code below checks
to see if the change is in column A. If the entry in columnA is a 'Z'. (This
can be changed to anything) then it adjusts the row height to 5. If it is
anything else it remains untouched. Just a starter bit of code. Here's how
you implement it.
(http://www.nickhodge.co.uk/vba/vbaim....htm#eventcode)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Columns("A:A"), Target) Is Nothing Then
With Application
.EnableEvents = False
If UCase(Target.Value) = "Z" Then
Target.RowHeight = 5
End If
.EnableEvents = True
End With
End If
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"CDAK" wrote in message
...
Is this code complicated or is it a simple sub? I've used VB a little bit
in
the past but never with Excel so I don't really know where to begin. Can
you
give me a little help with the code if you have the time?

"Nick Hodge" wrote:

Cannot be done without code

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"CDAK" wrote in message
...
I want to edit row height with conditional formatting. I have a query
behind
my spreadsheet and there are 3 types of products it returns (X, Y, Z).
When
it returns a Z product (product is a column heading), I want the row
height
to be much smaller than if it returns a X or Y product. Does anyone
know
how
this can be done? Thanks.








All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com