Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert a line at the bottom page Mahendra Excel Programming 3 April 19th 08 01:39 PM
Hyperlink line sometimes at bottom of displayed worksheet LDMueller Links and Linking in Excel 0 July 16th 07 01:16 PM
Place a Bottom Border in a Table via a Macro [email protected] Excel Discussion (Misc queries) 0 February 25th 07 11:19 PM
Run A Macro Against a Table Until it gets to bottom racer25 Excel Programming 2 November 4th 05 04:22 PM
Is there a macro function to find out if a cell contains a functi. venky Excel Programming 2 October 7th 04 07:05 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"