Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel cell padding?

Status
Not open for further replies.

hockeyboi16

Programmer
Aug 8, 2006
18
US
Is there a way to set excel's cell padding size?

right now the access to my sheet is:

Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")

and i'm setting stuff through:

excelsheet.application.cells(...).property

or through a range of cells.
 
padding size"?

I'm not sure what you mean.

But you can probably find your answer by using the Macro Recorder. Go to Tools > Macro > Record New Macro. Go through wahtever steps you are trying to automate. Observe the code that was generated.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 



Here it is...

Friday morning, and I already feel like I need some Cell Padding

!!!!!!!!!!!!! [hairpull3]

Skip,

[glasses] [red][/red]
[tongue]
 
what is mean by cell padding size is the distance between the content of a cell and the border.

not sure if there's a way to set it or not.
 
That is refered to as Column Width.

You can:
[tab]-click on the line between cells and drag it to any size you want
[tab]-double click on the line between cells to auto-fit to the width of the text
[tab]-Right click on a column header (or select multiple columns first and then right click on one of the column headers) and choose Column Width and manually set it.

Again, once you know what you want, turn on the macro recorder before doing this to capture the code.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
well, i think my description of what i want to do is confusing.

within a cell i have a lot of text (and word wrap is turned on). the column width is set at a specific size, so the text will wrap and the height of the column adjusts to whatever the amount of text is. the problem is that the next column over (to the right), the text in there looks as if it is part of this other column...so it looks like it's continuing.

this is just a UI thing...but is there a way to space this out?
 
John - what hockeyboi16 is referring to is under Format>Cells>Alignment.

If you set the cell to be left aligned, you can then set an "indent" amount which dictates how much space there is between the cell border and where the text starts

It is a property of a range and can be set by using:

Code:
Range("theRange").Indentlevel = 2

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top