Thread: Indentation
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Shane Devenshire Shane Devenshire is offline
external usenet poster
 
Posts: 857
Default Indentation

Hi,

I only had a few minutes earlier because I was on lunch, but here is your
code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("D1:D100"))
If Not isect Is Nothing Then
If Target = "Detroit" Then ActiveCell.Offset(0, -1).InsertIndent 1
If Target = "Toronto" Then ActiveCell.Offset(0, -1).InsertIndent 2
End If
End Sub


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"CB" wrote:

How can I indent a cell if another cell contains certain Data.

Example I want to
Indent C1 once if Cell D1 = Detroit
Indent C1 Twice if Cell D1 = Toronto

The sheet may have 400 row.

Any thoughts?