Hello,
I wrote the following macro, and it worked for a while, then I had to make a tweak and it is no longer working. The goal is to hide certain rows, open that filtered view in a new workbook, and save that workbook to the user's desktop:
Code
Sub ExportMFTasks()
BeginRow = 20
EndRow = 400
ChkCol = 3
Application.ScreenUpdating = False
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1").Select
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "COE" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "COE Strategy" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "COE Delivery" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "COE Delivery/COE Strategy" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "Vendor/COE Strategy" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "Vendor/COE Delivery" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "PCM" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "RIO" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "Quality Manager" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
If Cells(RowCnt, ChkCol).Value = "Vendor/COE" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
Application.ScreenUpdating = True
Sheets("CAMPAIGN").Select
Sheets("CAMPAIGN").Copy
ActiveWorkbook.SaveAs Filename:= _
Environ$("USERPROFILE") & "\Desktop\MF Task Export.xlsx", FileFormat:=xlOpenXMLWorkbook _
, CreateBackup:=False
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1").Select
Display More
Not sure where I went wrong -- help appreciated!
Thanks,
Corcelle