ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   formating current row to center text (thanks) (https://www.excelbanter.com/excel-programming/293773-re-formating-current-row-center-text-thanks.html)

No Name

formating current row to center text (thanks)
 
Thanks , I try this before but did not use the & .


-----Original Message-----
Because you have not specified any row in your command
Rows().Select
all rows are selected

Try



For lngROW = 3 To Rng.Rows.Count
cellchar = Cells(lngROW, 1).Value
If Mid(cellchar, 1, 10) = "==========" Then
ActiveWindow.SelectedSheets.HPageBreaks.Add
Befo=Cells(lngROW + 1, 1)
Application.StatusBar = "Row: " + Format(lngROW)
ElseIf Mid(cellchar, 1, 6) = "Agency" Then
Rows(lngROW - 1 & ":" & lngROW + 3).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
End If
Next lngROW


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 09:07 PM.

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