M
mkfunk27
this code does not seem to work when I want to have data reporting to
the same cell for
Mon-Friday and then move to a different cell for the next work week
Mon-Fri.
It will work for one day, but not if the code has multiple day
references to the same cell.
Code below...Any idea's?
Sub Autpen()
Dim dc As Date ' hold the date from the worksheet
Dim sCellAddress As String ' hold the address of the cell
dc = Worksheets("Daily").Range("A1")
If dc = DateSerial(2007, 5, 2) Then
sCellAddress = "B49"
ElseIf dc = DateSerial(2007, 5, 3) Then
sCellAddress = "B49"
ElseIf dc = DateSerial(2007, 5, 4) Then
sCellAddress = "B49"
ElseIf dc = DateSerial(2007, 5, 7) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 8) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 9) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 10) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 11) Then
sCellAddress = "C49"
End If
Worksheets("Weekly").Range(sCellAddress) =
Worksheets("Summary").Range("A2").PivotTable.GetPivotData("mnemonic",
"status", "OK")
the same cell for
Mon-Friday and then move to a different cell for the next work week
Mon-Fri.
It will work for one day, but not if the code has multiple day
references to the same cell.
Code below...Any idea's?
Sub Autpen()
Dim dc As Date ' hold the date from the worksheet
Dim sCellAddress As String ' hold the address of the cell
dc = Worksheets("Daily").Range("A1")
If dc = DateSerial(2007, 5, 2) Then
sCellAddress = "B49"
ElseIf dc = DateSerial(2007, 5, 3) Then
sCellAddress = "B49"
ElseIf dc = DateSerial(2007, 5, 4) Then
sCellAddress = "B49"
ElseIf dc = DateSerial(2007, 5, 7) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 8) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 9) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 10) Then
sCellAddress = "C49"
ElseIf dc = DateSerial(2007, 5, 11) Then
sCellAddress = "C49"
End If
Worksheets("Weekly").Range(sCellAddress) =
Worksheets("Summary").Range("A2").PivotTable.GetPivotData("mnemonic",
"status", "OK")