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

Hi,

You will need to use code. Here is some sample code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("D1:D400"))
If Not isect Is Nothing Then
'Your code here
End If
End Sub

Record the indent command and then place it into "Your code here

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.
--
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?