Phew, that took more than I bargained for.
the problem lay in this code
For Each myCell In myRng
If myCell.Value <> Sheets("B1_Scorecard").Range("H3") Then
Sheets("C1_Summary").Cells(FinalRow + 1, 3).Value = Sheets("B1_Scorecard").Range("H3")
End If
Next myCell
as unless the very first item is the same project, it will create a new one (the <> being true in this case). And then it needs the second and so on to be the same (never likely). I changed that to a match
Dim iMatchRow As Long
On Error Resume Next
iMatchRow = Application.Match(projectRng.Value, myRng, 0)
On Error GoTo 0
If iMatchRow = 0 Then
Sheets("C1_Summary").Cells(FinalRow + 1, 3).Value = projectRng.Value
iMatchRow = myRng(myRng.Count).Row - myRng.Row + 1
End If
I also changed the colun identification from the long Select Case to a single match, simpler and more extensible.
I hope that you don't mind, but I made a number of otehr changes as I was struggling making changes to suit, so I changed the lot to a more flexiible set (IMO). Hope it still works on a Mac
Here is the final code
Sub Macro1()
Dim myCell As Range, myRng As Range, checkRng As Range, check2Rng As Range
Dim campaignRng As Range, promoRng As Range, projectRng As Range, scoreRng As Range
Dim myStr As String
Dim FinalRow As Long
Dim k As Integer, m As Integer, p As Integer
Dim RowCt As Long
Dim cell As Range
Const RANGE_CHECK As String = "D6:D11" 'B1_Scorecard
Const RANGE_CHECK2 As String = "D15:D19" 'B1_Scorecard
Const RANGE_CAMPAIGN As String = "H2" 'B1_Scorecard
Const RANGE_PROJECT As String = "H3" 'B1_Scorecard
Const RANGE_SCORE As String = "D22" 'B1_Scorecard
Const RANGE_PROMO As String = "D4:L4" 'C1_Summary
FinalRow = Worksheets("C1_Summary").Cells(Rows.Count, "C").End(xlUp).Row
Set promoRng = Worksheets("C1_Summary").Range(RANGE_PROMO)
With Worksheets("B1_Scorecard")
Set campaignRng = .Range(RANGE_CAMPAIGN)
Set projectRng = .Range(RANGE_PROJECT)
Set checkRng = .Range(RANGE_CHECK)
Set check2Rng = .Range(RANGE_CHECK2)
Set scoreRng = .Range(RANGE_SCORE)
For Each cell In checkRng
If cell.Value = "" Then
MsgBox "Select ""Yes or No"" for cell " & cell.Address(False, False)
End If
Next cell
For Each cell In check2Rng
If cell.Value = "" Then
MsgBox "Select ""Yes, No or Exempt"" for cell " & cell.Address(False, False)
End If
Next cell
Set myRng = Worksheets("C1_Summary").Range("C4:C" & FinalRow)
Dim iMatchRow As Long
On Error Resume Next
iMatchRow = Application.Match(projectRng.Value, myRng, 0)
On Error GoTo 0
If iMatchRow = 0 Then
Sheets("C1_Summary").Cells(FinalRow + 1, 3).Value = projectRng.Value
iMatchRow = myRng(myRng.Count).Row - myRng.Row + 1
End If
Dim iMatchCol As Long
On Error Resume Next
iMatchCol = Application.Match(campaignRng.Value, promoRng, 0)
On Error GoTo 0
If iMatchCol > 0 Then
scoreRng.Copy
promoRng.Cells(iMatchRow, iMatchCol).PasteSpecial Paste:=xlPasteValues
campaignRng.Value = ""
checkRng.Value = ""
check2Rng.Value = ""
Else
MsgBox campaignRng.Value & " not matched"
End If
End With
Application.CutCopyMode = False
End Sub
PS watch the smileys