ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Indent size (https://www.excelbanter.com/excel-discussion-misc-queries/175414-indent-size.html)

Learner101b

Indent size
 
Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b

Jim Cone

Indent size
 

Use a leading space.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins - change text case with "XL Extras")



"Learner101b"
wrote in message
Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b

Gord Dibben

Indent size
 
No, you cannot change the indent below 1 or change the increments to decimals.

A <space is about half the width of an indent.

You could run a macro on currently entered text or use event code to add a space
before/after the text in each cell as you entered it.

Post back if interested in either method........or both.


Gord Dibben MS Excel MVP

On Sun, 3 Feb 2008 11:00:00 -0800, Learner101b wrote:

Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b



Learner101b

Indent size
 
If it is not too much trouble, I would appreciate both methods. I am only
semi-technical, but I can follow directions. I appreciate your help.

"Gord Dibben" wrote:

No, you cannot change the indent below 1 or change the increments to decimals.

A <space is about half the width of an indent.

You could run a macro on currently entered text or use event code to add a space
before/after the text in each cell as you entered it.

Post back if interested in either method........or both.


Gord Dibben MS Excel MVP

On Sun, 3 Feb 2008 11:00:00 -0800, Learner101b wrote:

Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b




Gord Dibben

Indent size
 
Event code first...........................

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module. Alt + q to return to the Excel window. Indent is produced when
you enter text(numerics will not trigger the event) into a cell in any cell in
My_Range. Right or left indent is up to you. Just swap the two lines by
removing or adding an apostrophe.

Private Sub Worksheet_Change(ByVal Target As Range)
Const My_Range As String = "A1:A100" 'adjust to suit your needs
Dim cell As Range
On Error GoTo endit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(My_Range)) Is Nothing Then
With Target.SpecialCells(xlCellTypeConstants, _
xlTextValues)
Target.Value = Target.Value & " " 'right indent
'OR
'Target.Value = " " & Target.Value 'left indent
End With
End If

endit:
Application.EnableEvents = True
End Sub

Macro code next.....................................

Alt + F11 to open the VBEditor. CTRL = r to open the Project Explorer.
Right-click on your workbook/project and InsertModule. Copy/paste the macro
below to that module.

Sub add_space()
Dim rngR As Range, rngRR As Range
Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues)
For Each rngR In rngRR
rngR.Value = rngR.Value & " "
'OR
'rngR.Value = " " & rngR.Value
Next
End Sub

Alt + q to return to the Excel window.

This macro can be run on any selected range by going to ToolsMacroMacros and
"Run". You could assign it to a button or shortcut key.


Gord

On Sat, 9 Feb 2008 09:51:00 -0800, Learner101b wrote:

If it is not too much trouble, I would appreciate both methods. I am only
semi-technical, but I can follow directions. I appreciate your help.

"Gord Dibben" wrote:

No, you cannot change the indent below 1 or change the increments to decimals.

A <space is about half the width of an indent.

You could run a macro on currently entered text or use event code to add a space
before/after the text in each cell as you entered it.

Post back if interested in either method........or both.


Gord Dibben MS Excel MVP

On Sun, 3 Feb 2008 11:00:00 -0800, Learner101b wrote:

Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b





Learner101b

Indent size
 
Works like a charm. I can even follow the code sort-of.

I appreciate you taking your time to help me with this since it is not
crucial to the result, but I do like spreadsheets to look 'pretty.' I could
never have figured out the code on my own.

Thanks again,
Learner101b

"Gord Dibben" wrote:

Event code first...........................

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module. Alt + q to return to the Excel window. Indent is produced when
you enter text(numerics will not trigger the event) into a cell in any cell in
My_Range. Right or left indent is up to you. Just swap the two lines by
removing or adding an apostrophe.

Private Sub Worksheet_Change(ByVal Target As Range)
Const My_Range As String = "A1:A100" 'adjust to suit your needs
Dim cell As Range
On Error GoTo endit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(My_Range)) Is Nothing Then
With Target.SpecialCells(xlCellTypeConstants, _
xlTextValues)
Target.Value = Target.Value & " " 'right indent
'OR
'Target.Value = " " & Target.Value 'left indent
End With
End If

endit:
Application.EnableEvents = True
End Sub

Macro code next.....................................

Alt + F11 to open the VBEditor. CTRL = r to open the Project Explorer.
Right-click on your workbook/project and InsertModule. Copy/paste the macro
below to that module.

Sub add_space()
Dim rngR As Range, rngRR As Range
Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues)
For Each rngR In rngRR
rngR.Value = rngR.Value & " "
'OR
'rngR.Value = " " & rngR.Value
Next
End Sub

Alt + q to return to the Excel window.

This macro can be run on any selected range by going to ToolsMacroMacros and
"Run". You could assign it to a button or shortcut key.


Gord

On Sat, 9 Feb 2008 09:51:00 -0800, Learner101b wrote:

If it is not too much trouble, I would appreciate both methods. I am only
semi-technical, but I can follow directions. I appreciate your help.

"Gord Dibben" wrote:

No, you cannot change the indent below 1 or change the increments to decimals.

A <space is about half the width of an indent.

You could run a macro on currently entered text or use event code to add a space
before/after the text in each cell as you entered it.

Post back if interested in either method........or both.


Gord Dibben MS Excel MVP

On Sun, 3 Feb 2008 11:00:00 -0800, Learner101b wrote:

Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b





Gord Dibben

Indent size
 
Thanks for the feedback.

Gord

On Sun, 10 Feb 2008 09:39:01 -0800, Learner101b wrote:

Works like a charm. I can even follow the code sort-of.

I appreciate you taking your time to help me with this since it is not
crucial to the result, but I do like spreadsheets to look 'pretty.' I could
never have figured out the code on my own.

Thanks again,
Learner101b

"Gord Dibben" wrote:

Event code first...........................

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module. Alt + q to return to the Excel window. Indent is produced when
you enter text(numerics will not trigger the event) into a cell in any cell in
My_Range. Right or left indent is up to you. Just swap the two lines by
removing or adding an apostrophe.

Private Sub Worksheet_Change(ByVal Target As Range)
Const My_Range As String = "A1:A100" 'adjust to suit your needs
Dim cell As Range
On Error GoTo endit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(My_Range)) Is Nothing Then
With Target.SpecialCells(xlCellTypeConstants, _
xlTextValues)
Target.Value = Target.Value & " " 'right indent
'OR
'Target.Value = " " & Target.Value 'left indent
End With
End If

endit:
Application.EnableEvents = True
End Sub

Macro code next.....................................

Alt + F11 to open the VBEditor. CTRL = r to open the Project Explorer.
Right-click on your workbook/project and InsertModule. Copy/paste the macro
below to that module.

Sub add_space()
Dim rngR As Range, rngRR As Range
Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues)
For Each rngR In rngRR
rngR.Value = rngR.Value & " "
'OR
'rngR.Value = " " & rngR.Value
Next
End Sub

Alt + q to return to the Excel window.

This macro can be run on any selected range by going to ToolsMacroMacros and
"Run". You could assign it to a button or shortcut key.


Gord

On Sat, 9 Feb 2008 09:51:00 -0800, Learner101b wrote:

If it is not too much trouble, I would appreciate both methods. I am only
semi-technical, but I can follow directions. I appreciate your help.

"Gord Dibben" wrote:

No, you cannot change the indent below 1 or change the increments to decimals.

A <space is about half the width of an indent.

You could run a macro on currently entered text or use event code to add a space
before/after the text in each cell as you entered it.

Post back if interested in either method........or both.


Gord Dibben MS Excel MVP

On Sun, 3 Feb 2008 11:00:00 -0800, Learner101b wrote:

Is there a way to change the size of the Text Alignment Indent size? I would
like a smaller indent and Excel will not accept a '.5'

Thanks for the help,
Learner101b







All times are GMT +1. The time now is 10:33 PM.

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