In the attached workbook, is it possible to auto populate from 'Time Sheets'!columns C,D and E to 'Dashboard'! B6:B36, E6:E36, H6:H36 a list of all names that fall within 'Dashboard'! "week ending" criteria?
Thanks for any and all help!
Sick
In the attached workbook, is it possible to auto populate from 'Time Sheets'!columns C,D and E to 'Dashboard'! B6:B36, E6:E36, H6:H36 a list of all names that fall within 'Dashboard'! "week ending" criteria?
Thanks for any and all help!
Sick
Yes with a little VBA. I infer...
a) you do not expect (= cannot ever have) more than 31 entries that are within the weekend
b) that by <fall within 'Dashboard'! "week ending" criteria > you mean have a date 0-6 days earlier than the date in C2
I could do this for you if no-one else is dashing it off as i write!
is "31" a reference to the size allotted on the sheet or a "max allowed"?
The length of the yellow ranges where the data is to go
If you could configure it for 100 entries:
1. I'd learn how to do it.
2. I could adjust it if needed.
Even I can change yellow fill. LOL!
Sick
Bother, missed out S + S + 1 which must be inserted below the If statement
Incidentally will cope without arbirary limit (31, 100, whatever)
You mean like this? I took off E from hours.
HTML Code:
I think this is about right:
good luck. (Going home now so cannot reply quickly)![]()
Option Explicit Dim ws As Worksheet Dim R As Integer, S As Integer Sub doit() Sheets("Time Sheet").Activate Set ws = Sheets("Dashboard") With ws Date2 = .Range("C2") Date1 = Date2 - 6 S = 6 ' Start Row Dashboard (I assume its empty) For R = 6 To ActiveSheet.UsedRange.Rows.Count If Cells(R, 2) >= Date1 And Cells(R, 2) <= Date2 Then ' record .Cells(S, 2) = Cells(R, 3) ' employee .Cells(S, 5) = Cells(R, 4) ' job .Cells(S, 8) = Cells(R, 5) ' Process .Cells(S, 3) = Cells(R, 6) ' Hourse .Cells(S, 6) = Cells(R, 6) ' Hourse .Cells(S, 93) = Cells(R, 6) ' Hourse End If Next End Sub
Moved S + S +1 and corrected last .cells.... line![]()
Option Explicit Dim ws As Worksheet Dim R As Integer, S As Integer Sub doit() Sheets("Time Sheet").Activate Set ws = Sheets("Dashboard") With ws Date2 = .Range("C2") Date1 = Date2 - 6 S = 6 ' Start Row Dashboard (I assume its empty) For R = 6 To ActiveSheet.UsedRange.Rows.Count If Cells(R, 2) >= Date1 And Cells(R, 2) <= Date2 Then ' record .Cells(S, 2) = Cells(R, 3) ' employee .Cells(S, 5) = Cells(R, 4) ' job .Cells(S, 8) = Cells(R, 5) ' Process .Cells(S, 3) = Cells(R, 6) ' Hours .Cells(S, 6) = Cells(R, 6) ' Hours .Cells(S, 9) = Cells(R, 6) ' Hours S + S + 1 End If Next End Sub
Last edited by brynbaker; 03-28-2013 at 02:05 PM. Reason: correction
the S + S + 1 keeps changing to S S + 1.
Still not working. I paste the code, save, close and reopen. Nope.
That's what happens when you type in something in a hurry. S = S + 1 will be huch happier
That's what happens when you type in something in a hurry. S = S + 1 will be huch happier
OK. This is what I have in Thisworkbook (Code)
Still not working. What have I missed?HTML Code:
Sick
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks