ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select a Range and Format (https://www.excelbanter.com/excel-programming/325555-select-range-format.html)

Jaina Williams

Select a Range and Format
 
I am looking to do 2 things
1 I want to select the whole worksheet and remove any
fill colors and then
I want to select a specific Range in a spreadsheet (eg
B5:d10) and right Justify all the data in the worksheet


Thanks

PaulD

Select a Range and Format
 
"Jaina WIlliams" wrote in message
...
: I am looking to do 2 things
: 1 I want to select the whole worksheet and remove any
: fill colors and then
: I want to select a specific Range in a spreadsheet (eg
: B5:d10) and right Justify all the data in the worksheet
:
: Thanks

Have you tried using the macro recorder while doing this? It will write the
code for you.
Paul D



Lonnie M.

Select a Range and Format
 
Hi, if you record a macro and manually do what you describe it will
generate the following code:

Cells.Select
Selection.Interior.ColorIndex = xlNone
Range("B5:D10").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

HTH--Lonnie M.


Bob Phillips[_6_]

Select a Range and Format
 
But then you should tidy it up to get rid of the garbage

Cells.Interior.ColorIndex = xlNone
Range("B5:D10").HorizontalAlignment = xlRight

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Lonnie M." wrote in message
oups.com...
Hi, if you record a macro and manually do what you describe it will
generate the following code:

Cells.Select
Selection.Interior.ColorIndex = xlNone
Range("B5:D10").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

HTH--Lonnie M.





All times are GMT +1. The time now is 11:01 AM.

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