Format a column from the last row of data on up

  • Thread starter Thread starter MultiMatt
  • Start date Start date
M

MultiMatt

Merjet helped me with a macro to locate some particular data and
delete that row on down, and now I have one final formatting thing I
want to do:

I'd like to place a border around a column from the last row of data
in the worksheet, on up to the top.
The column is "AD".

I'm pretty sure I can figure out the macro to find the last row, but I
don't know how to fit in the code to say "format column "AD" from that
row on up"!!!

Thanks in advance, and thank you Merjet, for helping me with the other
macro!

Matt
 
Select your range:

Cells(AD1:AD lastrow ).Select


Then this will format whatever you have selected:

Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone


Another suggestion is to do it by hand and record the Macro while
doing it then modify to just select the range.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top