I need to add to a current macro which currently copies the master tab and creates a new tab with tomorrow's date on it. For reference here is the current macro:
I want to add a bit that opens P:\Call Center Operations\checkin.xls and looks in Column D for the values HRRESL, HRRERN, TVREAS & HRRETA and places the counts in B12, B13, B15 & B18 of tomorrow's tab in the main workbook, respectively.Dim TodayDate As Date Dim DashDate As Date Dim DashDate_text As String Dim T_Date As Date T_Date = (Date + 1) TodayDate = Format(T_Date, "mm/dd/yy") DashDate = (Date + 1) DashDate_text = Format((DashDate), "dd") Tabdate = Format(DashDate, "dd") Sheets("Master").Select Sheets("Master").Copy After:=Sheets("Master") Sheets("Master (2)").Select Sheets("Master (2)").Name = Tabdate
I think I mainly need help in wording a CountIf statement for the four values. I am fairly certain I can figure the rest out. (but if I can't you'll hear from me)
Thanks ahead of time ... cuz I KNOW ya'll rock!!
Last edited by delirium; 06-01-2009 at 07:35 PM.
Maybe like this (completely untested):
Sub x() Dim wks As Worksheet Worksheets("Master").Copy After:=Worksheets("Master") Set wks = ActiveSheet wks.Name = Format(Date + 1, "dd") Workbooks.Open "P:\Call Center Operations\checkin.xls" With wks.Range("B12:B18") .Cells(1).Formula = "=countif('[checkin.xls]Sheet1'!D:D, ""RRESL"")" .Cells(2).Formula = "=countif('[checkin.xls]Sheet1'!D:D, ""HRRERN"")" .Cells(4).Formula = "=countif('[checkin.xls]Sheet1'!D:D, ""TVREAS"")" .Cells(7).Formula = "=countif('[checkin.xls]Sheet1'!D:D, ""HRRETA"")" .Value = .Value End With ActiveWorkbook.Close SaveChanges:=False End Sub
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Am I allowed to say that I love you?
Just marking the thread Solved would be sufficient, thanks.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks