Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add a line at the bottom of a table with prefilled functi
I need to create a macro to add a line to the bottom of an existing table but
it needs to prefill the same functions as the rest of the rows in the table (each column has the same function but it is specific to the row) I also need it to remove all data that is not a function. Effectively giving you a new row to input new data for that row. Any help on where to start would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add a line at the bottom of a table with prefilledfuncti
On 7 jan, 14:06, Maypop wrote:
I need to create a macro to add a line to the bottom of an existing table but it needs to prefill the same functions as the rest of the rows in the table (each column has the same function but it is specific to the row) I also need it to remove all data that is not a function. Effectively giving you a new row to input new data for that row. Any help on where to start would be greatly appreciated. Hi Maypop, In Excel 2003 I have created this macro which copies down all functions of a row. Sub CopyFunctionsOnly() Dim lastRow As Long Dim lastCol As Long Dim loopCol As Long lastRow = Cells(Cells.Rows.Count, 1).End(xlUp).Row lastCol = Cells(1, Cells.Columns.Count).End(xlToLeft).Column Cells(lastRow, 1).Select For loopCol = 1 To lastCol If Not IsEmpty(Cells(lastRow, loopCol)) Then With Cells(lastRow, loopCol) If Not .Formula = .Text Then Cells(lastRow, loopCol).Resize(2, 1).Select Selection.FillDown End If End With End If Next End Sub HTH, Wouter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert a line at the bottom page | Excel Programming | |||
Hyperlink line sometimes at bottom of displayed worksheet | Links and Linking in Excel | |||
Place a Bottom Border in a Table via a Macro | Excel Discussion (Misc queries) | |||
Run A Macro Against a Table Until it gets to bottom | Excel Programming | |||
Is there a macro function to find out if a cell contains a functi. | Excel Programming |