Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the macro below, I am attempting to test the value of the contents
of an Column (F). Based on that value, the macro should copy the row contents to a new workbook. I suspect I am attempting to use the wrong command as I am a newbie. Compile error is: Statement invalid outside Type block Sub UPDATE_STATUS() ' Purpose of this section is to delete old data from resultant worksheets Sheets("Personal").Select Rows("2:65535").Select Selection.Delete Shift:=xlUp Sheets("Corporate").Select Rows("2:65535").Select Selection.Delete Shift:=xlUp Sheets("Disconnect").Select Rows("2:65535").Select Selection.Delete Shift:=xlUp ' Purpose of this section is copying of data to appropriate resultant worksheets Sheets("Master").Select Range("F:F") As Range If Value = "P" Then Cells(Row, 1).Resize(1, 29).Copy Destination:=Worksheets("Personal").Cells(Rows.Cou nt, 1).End(xlUp)(2) End If If Value = "C" Then Cells(Row, 1).Resize(1, 29).Copy Destination:=Worksheets("Corporate").Cells(Rows.Co unt, 1).End(xlUp)(2) End If If Value = "D" Then Cells(Row, 1).Resize(1, 29).Copy Destination:=Worksheets("Disconnect").Cells(Rows.C ount, 1).End(xlUp) (2) End If ActiveWorkbook.Save End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Really simple macro problem - I bet! | New Users to Excel | |||
Run Macro through an entire range | Excel Programming | |||
Simple macro problem | Excel Programming | |||
simple range problem | Excel Discussion (Misc queries) |