Thread: Main Sheet
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Main Sheet


Sub CopyToMain()

Set MainSht = Sheets("Main")
With MainSht
.Rows("2:" & Rows.Count).Delete
MainRow = 2
End With

For Each sht In Sheets
If UCase(sht.Name) < "MAIN" Then
With sht
RowCount = 2
Do While .Range("A" & RowCount) < ""

Employee = .Name
RowDate = .Range("A" & RowCount)
If RowDate = Date Then
MainSht.Range("A" & MainRow) = Employee
MainSht.Range("B" & MainRow) = Date
PC = .Range("B" & RowCount)
MainSht.Range("C" & MainRow) = PC
AU = .Range("C" & RowCount)
MainSht.Range("D" & MainRow) = AU
MainRow = MainRow + 1
End If
RowCount = RowCount + 1
Loop
End With
End If

Next sht


End Sub


"Ranjith Kurian" wrote:

Hi,

I have more than two sheets and the first sheet is named as Main and the
other sheets are named as per employee names, everyday each person update
there work assigned status to the respective sheets, i need a macro to
consolidate the total count of PC column and AU column as per todays date to
main sheet as examples shown below

sheet Main:
EMP Date PC AU

sheet X:
Date PC AU
27-05-09
28-05-09 completed audit
29-05-09 completed audit
29-05-09

sheet Y:
Date PC AU
27-05-09
28-05-09 completed audit
29-05-09 completed audit
29-05-09 completed

Answer required is as below, i need the count of x and y sheets only todays
details, every day when i open main sheet it should show me only todays
information (yesterday data need to be replaced by today everday)

EMP Date PC AU
X 29-05-09 1 1
Y 29-05-09 2 1