Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Not too familiar with macros but I'm assuming there is a way to create
a macro that can find the last row containing data in a sheet and add another row after the last item. The catch is that the added row should carry the same formatting as the previous. Is this do-able? Thanks, Matt |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
a macro that can find the last row containing data in a sheet and add
another row after the last item. Is there mode data further down the sheet? If not then try: Sub FormatIt() Dim LastRow As Long LastRow = Cells(Rows.Count, 1).End(xlUp).Row Rows(LastRow).Copy Rows(LastRow + 1).PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Cells(LastRow + 1, 1).Select End Sub This assumes that there is data in Column A. If there is more data further down the sheet try: Sub FormatIt() Dim LastRow As Long LastRow = Cells(5, 1).End(xlDown).Row Cells(LastRow + 1, 1).EntireRow.Insert Rows(LastRow).Copy Rows(LastRow + 1).PasteSpecial Paste:=xlFormats Application.CutCopyMode = False Cells(LastRow + 1, 1).Select End Sub -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Matt" wrote in message ups.com... Not too familiar with macros but I'm assuming there is a way to create a macro that can find the last row containing data in a sheet and add another row after the last item. The catch is that the added row should carry the same formatting as the previous. Is this do-able? Thanks, Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |