Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Im using this macro, i dont get any errors but it doesnt
clear rows a or b if rows c:u are unpopulated which is what im aiming for. Sub Macro1() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+Shift+S ' ChDir "C:\Documents and Settings\sds\Desktop" Workbooks.Open FileName:= _ "C:\Documents and Settings\sds\Desktop\MORNINGPREALERT.xls" Range("A1:U7").Select Selection.ClearContents Cells.Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Delete Shift:=xlUp Dim rng As Range, cell As Range Set rng = Range(Range("C1"), Cells(Rows.Count, 3).End (xlUp)) For Each cell In rng If Application.CountA(cell.Resize(1, 18)) = 0 Then Cells(cell.Row, 1).Resize(1, 2).ClearContents End If Next Cells.Select Selection.Cut Workbooks.Add ActiveSheet.Paste ActiveWorkbook.SaveAs FileName:= _ "C:\Documents and Settings\sds\Desktop\MORNING LABELS.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False ActiveWindow.Close ActiveWindow.Close End Sub |