Indent based on Entry

J

JSnow

I'm entering either 'no' or 'yes' in column D. If I enter 'yes' I would like
that text to automatically indent by 1 space (.IndentLevel = 1) so that it
sticks out to me. Please help me you Gods of Excel.
 
G

Gary''s Student

Put the following event code in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("D:D")
Set t = Target
If Intersect(t, r) Is Nothing Then Exit Sub
If t.Value = "yes" Then
t.InsertIndent 1
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top