So here is my issue. I have fumbled around multiple forums trying to find the answer. I am new to vba for excel and I have hacked together a macro from bits of code I found in these forums. It does what I need it to except for one caveat, the second part of the macro uses a set range but i realized as the sheet keeps getting bigger the row numbers will change. So I need a way to copy only rows with data in them to another worksheet in another workbook.
The first part of the macro goes through and hides every row that doesn't have today's date. it works great. the next part copies whats left and it works but as they are constantly adding to this sheet it will work once then the range will be wrong the next time they use it.
Any help would be greatly appreciated.
The first part of the macro goes through and hides every row that doesn't have today's date. it works great. the next part copies whats left and it works but as they are constantly adding to this sheet it will work once then the range will be wrong the next time they use it.
Code:
Sub automate()Dim cell As Range
For Each cell In Range("AB2:AB30000")
If cell.Value < Date And cell.Value <> Empty Then cell.EntireRow.Hidden = True
Next
Range("K28336:K28388,O28336:O28388,P28336:P28388,Q28336:Q28388,R28336:R28388,S28336:S28388,T28336:T28388,U28336:U28388,V28336:V28388,Y28336:Y28388,AA28336:AA28388,AB28336:AB28388").Select
Selection.Copy
Workbooks.Open ("\\gvwac09\Public\Parts\Test\2014 IPU\2014 IPU.xlsx")
Sheets("Historical Data").Activate
ActiveSheet.Range("c1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteFormats
ActiveSheet.Paste
End Sub
Any help would be greatly appreciated.