Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
I know it is possible for formulas, etc, but is it possible to have a macro
that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
hi,
yes it is possible. What row? what format? regards FSt1 "Keep It Simple Stupid" wrote: I know it is possible for formulas, etc, but is it possible to have a macro that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
hi
excuse....what column? regards FSt1 "FSt1" wrote: hi, yes it is possible. What row? what format? regards FSt1 "Keep It Simple Stupid" wrote: I know it is possible for formulas, etc, but is it possible to have a macro that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
Format: The diagonal line going through the cell (lower left to upper right)
Row: The last row that is populated (remember, this will change everytime I run the macro) Column: D In other words: Selection.Borders(xlDiagonalDown).Linestyle=xlNone With selection.borders(xlDiagonalup) .Linestyle=xlContinuous .Weight=xlHairline ..ColorIndex=xlAutomatic .... "FSt1" wrote: hi, yes it is possible. What row? what format? regards FSt1 "Keep It Simple Stupid" wrote: I know it is possible for formulas, etc, but is it possible to have a macro that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
hi
this should work. try it and post back if problems. sub addformats() Dim r As Long lr = cells(Rows.Count, "D").End(xlUp).Row Range("D1:D" & lr).Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With End Sub Regards FSt1 "Keep It Simple Stupid" wrote: Format: The diagonal line going through the cell (lower left to upper right) Row: The last row that is populated (remember, this will change everytime I run the macro) Column: D In other words: Selection.Borders(xlDiagonalDown).Linestyle=xlNone With selection.borders(xlDiagonalup) .Linestyle=xlContinuous .Weight=xlHairline .ColorIndex=xlAutomatic ... "FSt1" wrote: hi, yes it is possible. What row? what format? regards FSt1 "Keep It Simple Stupid" wrote: I know it is possible for formulas, etc, but is it possible to have a macro that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
Sub Auto_Format()
Dim Lrow As Long With ActiveSheet Columns(3).Cells.Interior.ColorIndex = xlNone Lrow = Range("C" & Rows.Count).End(xlUp).Row Range("C1:C" & Lrow).Interior.ColorIndex = 3 End With End Sub Gord Dibben MS Excel MVP On Mon, 12 Nov 2007 07:18:02 -0800, Keep It Simple Stupid wrote: I know it is possible for formulas, etc, but is it possible to have a macro that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Format Fill Down to Last Row
I would add one line to clear the borders from the previous range.
Otherwise they will remain if number of rows is less than previous. Sub addformats() Dim r As Long lr = Cells(Rows.Count, "D").End(xlUp).Row Columns("D").Borders(xlDiagonalUp).LineStyle = xlNone 'add this line Range("D1:D" & lr).Select 'this line not needed Selection.Borders(xlDiagonalDown).LineStyle = xlNone With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With End Sub Gord On Mon, 12 Nov 2007 08:20:05 -0800, FSt1 wrote: hi this should work. try it and post back if problems. sub addformats() Dim r As Long lr = cells(Rows.Count, "D").End(xlUp).Row Range("D1:D" & lr).Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With End Sub Regards FSt1 "Keep It Simple Stupid" wrote: Format: The diagonal line going through the cell (lower left to upper right) Row: The last row that is populated (remember, this will change everytime I run the macro) Column: D In other words: Selection.Borders(xlDiagonalDown).Linestyle=xlNone With selection.borders(xlDiagonalup) .Linestyle=xlContinuous .Weight=xlHairline .ColorIndex=xlAutomatic ... "FSt1" wrote: hi, yes it is possible. What row? what format? regards FSt1 "Keep It Simple Stupid" wrote: I know it is possible for formulas, etc, but is it possible to have a macro that formats a column of cells and only formats down to the last row? It will always be the same column, but there will be a different number of rows each time. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can search by cell format like fill color? | Excel Worksheet Functions | |||
Can't format font colors or cell fill-in colors | Excel Discussion (Misc queries) | |||
How do you format a sheet to fill the entire page to print? | Excel Discussion (Misc queries) | |||
How do I format a picture fill in my pie chart? | Charts and Charting in Excel | |||
Can I format a cell to fill red when clicked with mouse (Excel)? | Excel Worksheet Functions |