D/RICK
Slight language understanding problem. "then odds are nothing you have done
has
> affected the alignment format of the last cell in each column. If that is
> the case, then this macro should realign the ......"
I understand that if I have formatted the complete column then regardless
whatever deleting and clearing contents I do the format should not change--.
Did i understand it correctly??
Secondly, the macro code, how to know how is it aligning (left, right,
middle) bcos I read only horizontal alignment.
Thirdly, where shall i attach this macro.
I would have responded earlier but firefox was not opening the answer and
finally i had to open in IE to see ur help. Thanks for your prompt help.
Pls help little further.
brgds/captgnvr
"Rick Rothstein (MVP - VB)" wrote:
> Assuming you applied your alignment formatting to the entire column and not
> just to a selection of cells, then odds are nothing you have done has
> affected the alignment format of the last cell in each column. If that is
> the case, then this macro should realign the entries in your cells to
> whatever the alignment format for the column it's in is...
>
> Sub RealignColumns()
> Dim C As Range
> For Each C In Columns
> C.HorizontalAlignment = Cells(Rows.Count, C.Column).HorizontalAlignment
> Next
> End Sub
>
> Rick
>
>
> "CAPTGNVR" <(E-Mail Removed)> wrote in message
> news:46AACAE6-A66B-4B3C-9468-(E-Mail Removed)...
> > DEAR ALL
> >
> > I have a sheet full of names, dates and particulars. Over a period of
> > time
> > some parts of the sheet is copied and dragged down, some cells erased
> > etc
> > using 'clear contents' in VB .
> >
> > Invariably some of the cell loses its format and few will be aligned
> > center
> > and some left and some right. Since the sheet is protected, can anyone
> > suggest what is the best way to keep the format that was made for each
> > column
> > regardless of the shifting and deleting data.
> >
> > VB is not a solution bcos I dont intend to sit and write alignment code
> > for
> > 100 columns and hence pls help - is there a way out?
> >
> > brgds/captgnvr
>
>
|