Macro to border cells, Shift Cells xldown, instead of Shift EntireRow xldown
Posted by Mike Winters on December 01, 2001 7:47 AM
Ok, I have two questions, first:
In a macro that sorts through data on the first sheet, and places the sorted data on the fourth sheet, I use the line:
Rng.EntireRow.Insert Shift:=ShiftxlDown
what is the command that will only shift the cells in that column down? The way it is doing it now, as more data is sorted (and placed to the right of the previously sorted data), it bumps down everything to the left, so by the time my final set of data gets sorted, the first set has a entire page (or two or more) of blank cells. It is imperative I get this figured out, I don't want to have to make a new worksheet for each set of data (that will mean something like 10 new worksheets).
Second question: in the same macro, how can I have it automatically place a xlthin border around all cells within a specified range, which is determined by the last row that has any cells that still have data in it?
IE, if the furthest down any data extends to is, say, row 50, and that is in cell G (but that can change, this needs to search all rows), how do I make the border around all cells in range A1:Z#, where # is the last row with data in it. I know this sounds vague, but I can't think of any way to better explain it. I can send the file to you if you still cannot see what I am trying to do.
Sincerely,
Mike Winters
United States Army