![]() |
Archive Macro
Hi All
I have a macro (see below), that archives information but needs some fine tuning. I have two questions that I hope someone can answer. Firstly, in the selected ranges, they are not always fully populated. Is it possible for the macro to detect if there is an entry in P1:P60 AND AC1:AC60 and only allow those lines that are populated to be archived. Secondly, I want to add the current date to each row that has been archived in column "A". I would appreciate any assistance that can be offered. Regards Michael Sheets("STROKE").Select Range("E5:P60").Select Selection.Copy Sheets("ARCHIVE").Select Range("B1").Select Do While Not IsEmpty(ActiveCell) ActiveCell.Offset(1, 0).Select Loop Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Sheets("STROKE").Select Range("R5:AC60").Select Selection.Copy Sheets("ARCHIVE").Select Range("B1").Select Do While Not IsEmpty(ActiveCell) ActiveCell.Offset(1, 0).Select Loop Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False End Sub |
Archive Macro
<<only allow those lines that are populated to be archived
The quickest way is to sort the range so the blanks are put to th bottom, otherwise you need a macro to delete the empty rows. <<add the current date to each row Worksheets("STROKE").Range("A1:A60").Value = No -- Message posted from http://www.ExcelForum.com |
Archive Macro
Brian
Thanks for your response. The date part was perfect. However, due to the layout of the range of cells, I can't sort and put the blanks to the bottom......so the Macro is the better option. Ideally the Macro would look in "P1:P60" and if there was nothing in the cell it would delete the row. Is this possible with a Macro. Regards Michael -----Original Message----- <<only allow those lines that are populated to be archived The quickest way is to sort the range so the blanks are put to the bottom, otherwise you need a macro to delete the empty rows. <<add the current date to each row Worksheets("STROKE").Range("A1:A60").Value = Now --- Message posted from http://www.ExcelForum.com/ . |
All times are GMT +1. The time now is 01:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com