how can I place data in same cell for a range of days?

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 Auto_Open()

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top