ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range text alignment (https://www.excelbanter.com/excel-programming/379415-range-text-alignment.html)

keri

Range text alignment
 
I have searched other posts and tried to implement the answers but I
still do not have code that works.

I have code so far that says;

ActiveSheet.Range("a1:p1").Font.Bold = True
ActiveSheet.Range("a1:l500").Borders.LineStyle = xlNone

etc

I want to add a line that aligns the text in the named range to the
left. I found a post that suggested this

ActiveSheet.Range("a1:n500").HorizontalAlignment = xlLeft

However when I run this code it changes all of my values in the
selected range to #######


Thanks.


Ken

Range text alignment
 
keri

It seems unlikely that changing the alignment would give you ####, but,
if the alignment is done in conjunction with the ...font.bold=true
line, it could be that the column is no longer wide enough.

Ken


keri wrote:
I have searched other posts and tried to implement the answers but I
still do not have code that works.

I have code so far that says;

ActiveSheet.Range("a1:p1").Font.Bold = True
ActiveSheet.Range("a1:l500").Borders.LineStyle = xlNone

etc

I want to add a line that aligns the text in the named range to the
left. I found a post that suggested this

ActiveSheet.Range("a1:n500").HorizontalAlignment = xlLeft

However when I run this code it changes all of my values in the
selected range to #######


Thanks.




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

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