I've got a data range across A:K, with headers in row 3 (all data entries beginning in row 4). I'm trying to run a macro which takes the prospect's name in A, and tells me which cells in C:K, if any, are blank for each producer's initials found in B. For example:
If A4:K4 are all filled, it goes to the next row. For row 5, let's say F5 and J5 are the only blank cells. At this point, A5 will be copied & pasted onto a new sheet, and the headers for the blank cells will be copied & pasted in the cells next to where A5 was pasted. This process will work its way down the spreadsheet for each row with one producer's initials, then once it reaches the bottom it will start again with another producer.
I've already got the code to create a new sheet, and to copy the headers of the blank cells. I'm only having trouble telling the code to find any blank cells within the range C:K for the active row, then copying any & all headers of the blank cells.
Right now this is what I have in terms of copying & pasting the headers on a new sheet.
This is just for the first producer (not a real name), but it should be a simple matter of repeating for each set of initials.
Please let me know if you've got any ideas. Thanks!
Eric
If A4:K4 are all filled, it goes to the next row. For row 5, let's say F5 and J5 are the only blank cells. At this point, A5 will be copied & pasted onto a new sheet, and the headers for the blank cells will be copied & pasted in the cells next to where A5 was pasted. This process will work its way down the spreadsheet for each row with one producer's initials, then once it reaches the bottom it will start again with another producer.
I've already got the code to create a new sheet, and to copy the headers of the blank cells. I'm only having trouble telling the code to find any blank cells within the range C:K for the active row, then copying any & all headers of the blank cells.
Right now this is what I have in terms of copying & pasting the headers on a new sheet.
Code:
Sub ToDoList()
Dim producer As String
Dim prospect As Long
Dim lngRows As Long
Dim blankCol As Long
Application.ScreenUpdating = False
Worksheets.Add
ActiveSheet.Move After:=Sheets(ActiveWorkbook.Sheets.Count)
ActiveSheet.Name = ("To Do List")
ThisWorkbook.Sheets("Master").Activate
Range("a4").Select
Do Until IsEmpty(ActiveCell) And IsEmpty(ActiveCell.Offset(1, 0))
prospect = ThisWorkbook.Sheets("To Do List").Cells(Rows.Count, 1).End(xlUp).Row + 1
blankCol = ThisWorkbook.Sheets("To Do List").Cells(Columns.Count, 1).End(xlUp).Column + 1
lngRows = ActiveCell.Row
producer = ActiveCell.Offset(0, 1).Value
ThisWorkbook.Sheets("To Do List").Activate
Range("a1").Select
ActiveCell.Font.Bold = True
ActiveCell = "JOHN SMITH'S INCOMPLETES"
ThisWorkbook.Sheets("Master").Activate
Rnage("a4").Select
If producer = "JS" Or producer = "js" Then
ActiveCell.Copy
ThisWorkbook.Sheets("To Do List").Activate
Cells(prospect, 1).Select
ActiveCell.PasteSpecial
Range("A" & prospect).Select
ThisWorkbook.Sheets("Master").Select
If IsEmpty(ActiveCell.Offset(0, 2)) Or IsEmpty(ActiveCell.Offset(0, 3)) Or IsEmpty(ActiveCell.Offset(0, 4)) Or IsEmpty(ActiveCell.Offset(0, 5)) Or IsEmpty(ActiveCell.Offset(0, 6)) Or IsEmpty(ActiveCell.Offset(0, 7)) Or IsEmpty(ActiveCell.Offset(0, 8)) Or IsEmpty(ActiveCell.Offset(0, 9)) Or IsEmpty(ActiveCell.Offset(0, 10)) Then
ActiveCell.Offset(-lngRows + 3, 2).Copy \\*this would be if column C was blank, but I need something to copy all headers of blank cells*\\
ThisWorkbook.Sheets("To Do List").Activate
Cells(prospect, blankCol).Select
ActiveCell.PasteSpecial
Range("A" & prospect).Select
ThisWorkbook.Sheets("Master").Select
End If
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
This is just for the first producer (not a real name), but it should be a simple matter of repeating for each set of initials.
Please let me know if you've got any ideas. Thanks!
Eric