Hide or chg the font to white?

  • Thread starter Thread starter Heather
  • Start date Start date
H

Heather

Is there a way for me to hide all of the below results if the Quantity is 0 in
..Offset(2, 3) = Worksheets("Sheet2").Range("B4") ' Quantity

this is the section that would need to hide or maybe somehow turn the font
white so it doesn't show up?
With target
.Offset(, 0) = "Options"
.Offset(1, 0) = "Options in Months"
.Offset(1, 1) = Worksheets("Sheet2").Range("B36") ' Option
Deal Duration
.Offset(2, 0) = Worksheets("Sheet2").Range("B32") ' Option
Description
.Offset(2, 1) = Worksheets("Sheet2").Range("B33") ' Type
.Offset(2, 2) = Worksheets("Sheet2").Range("B31") ' PN
.Offset(2, 3) = Worksheets("Sheet2").Range("B4") ' Quantity
.Offset(2, 4) = Worksheets("Sheet2").Range("B13") ' Unit List
Price
.Offset(2, 11) = Worksheets("Sheet2").Range("B27") ' Allocation
Price
.Offset(2, 6) = Worksheets("Sheet2").Range("B14") ' Ext List
Price
.Offset(2, 5) = Worksheets("Sheet2").Range("B34") ' Discounted
Price per User
.Offset(2, 7) = Worksheets("Sheet2").Range("B35") ' Ext
Discounted List Price



End With
 
Would it be practical to use an If ... Then statement to test
Worksheets("Sheet2").Range("B4").Value before doing any of the rest amd if
that value is 0 then do nothing?

If Worksheets("Sheet2").Range("B4").Value > 0 Then
With target
.Offset(, 0) = "Options"
.Offset(1, 0) = "Options in Months"
.Offset(1, 1) = Worksheets("Sheet2").Range("B36") ' Option
Deal Duration
.Offset(2, 0) = Worksheets("Sheet2").Range("B32") ' Option
Description
.Offset(2, 1) = Worksheets("Sheet2").Range("B33") ' Type
.Offset(2, 2) = Worksheets("Sheet2").Range("B31") ' PN
.Offset(2, 3) = Worksheets("Sheet2").Range("B4") ' Quantity
.Offset(2, 4) = Worksheets("Sheet2").Range("B13") ' Unit List
Price
.Offset(2, 11) = Worksheets("Sheet2").Range("B27") ' Allocation
Price
.Offset(2, 6) = Worksheets("Sheet2").Range("B14") ' Ext List
Price
.Offset(2, 5) = Worksheets("Sheet2").Range("B34") ' Discounted
Price per User
.Offset(2, 7) = Worksheets("Sheet2").Range("B35") ' Ext
Discounted List Price
End If

This way if the value is not greater than 0, it does nothing.
 
or add this just befopre the end with

if .Offset(2, 3) = 0 then rows( .Offset(2, 3).Row.Hidden = True
 
thanks Patrick -- it's giving me a syntax error tho' I placed it just under
the Ext Discounted List Price and just before End With?
 
Back
Top