Hi, thanks for your message. Sorry for the delay... was hoping that I could load a test timesheet template to show you, but I don't know if its possible on a thread chat?
So column data...
Initial column of your data A
- Final column of your data.AM
- Initial row of data. 12
- Row of headings.11
- In which column values equal to 0 should be removed = From the "hours" column for each element
- Which columns will be copied and what will be the order in the file. Copied will be column A "Emp", Pay element "88" (in cell "C8") then Basic hours column C, then rate from column D.
- File name. Import file creation
- File path. C:// my documents
- CSV separated by commas? Yes by commas.
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Rate[/TD]
[TD="width: 64"]Column A[/TD]
[TD="width: 64"]STARTS ON ROW 12[/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay[/TD]
[TD]Column B[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Hours[/TD]
[TD]Column C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Rate[/TD]
[TD]d[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay[/TD]
[TD]e[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Hours[/TD]
[TD]f[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Rate[/TD]
[TD]g[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay[/TD]
[TD]h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Hours[/TD]
[TD]i[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Rate[/TD]
[TD]j[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay[/TD]
[TD]k[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Hours[/TD]
[TD]l[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Rate[/TD]
[TD]m[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay[/TD]
[TD]n[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Hours[/TD]
[TD]o[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay Rate[/TD]
[TD]p[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 128, colspan: 2"]Basic Pay[/TD]
[TD]q[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 64"]Holiday[/TD]
[TD="class: xl70, width: 64"]Hours[/TD]
[TD]r[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 64"]Holiday Pay[/TD]
[TD="class: xl70, width: 64"]Rate[/TD]
[TD]s[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 64"]Holiday[/TD]
[TD="class: xl70, width: 64"]Pay[/TD]
[TD]t[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 64"]Holiday[/TD]
[TD="class: xl70, width: 64"]Hours[/TD]
[TD]u[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 64"]Holiday Pay[/TD]
[TD="class: xl70, width: 64"]Rate[/TD]
[TD]v[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl64, width: 64"]Holiday[/TD]
[TD="class: xl70, width: 64"]Pay[/TD]
[TD]w[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 128, colspan: 2"]Training Hours/Courses[/TD]
[TD]x[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 128, colspan: 2"]Training Rate[/TD]
[TD]y[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 128, colspan: 2"]Training[/TD]
[TD]z[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl66, width: 128, colspan: 2"]Shadowing Hours[/TD]
[TD]AA[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl66, width: 128, colspan: 2"]Shadowing Rate[/TD]
[TD]AB[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl66, width: 128, colspan: 2"]Shadowing[/TD]
[TD]AC[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl67, width: 128, colspan: 2"]Xmas Pay Hours[/TD]
[TD]AD[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl67, width: 128, colspan: 2"]Xmas Pay Rate[/TD]
[TD]AE[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl67, width: 128, colspan: 2"]Xmas pay[/TD]
[TD]AF[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The following columns .....................
We will need "ee(col A), Pay element (BEcol R11) then
always 1.00 hour (this isn't on the timesheet) then rate will be the "total amount" (AG Col R12)
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl68, width: 128, colspan: 2"]Travel Time[/TD]
[TD]AG[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Expenses[/TD]
[TD]AH[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Dom Care On Call[/TD]
[TD]AI[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Senior Increment[/TD]
[TD]AJ[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Pay Adjustment[/TD]
[TD]AK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Missed Calls[/TD]
[TD]AL[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Finders Fee[/TD]
[TD]AM[/TD]
[/TR]
</tbody>[/TABLE]
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl68, width: 128, colspan: 2"]Travel Time[/TD]
[TD]AG[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Expenses[/TD]
[TD]AH[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Dom Care On Call[/TD]
[TD]AI[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Senior Increment[/TD]
[TD]AJ[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Pay Adjustment[/TD]
[TD]AK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Missed Calls[/TD]
[TD]AL[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 128, colspan: 2"]Finders Fee[/TD]
[TD]AM[/TD]
[/TR]
</tbody>[/TABLE]
</body>
I have done very basic VBA, so if you can justs start me off with the coding, I can always have a go at finishing it off.
Another thing to note is that new employees can be added to the timesheet each week, so row91 may not always be the last data row. So I was thinking of using the follow
'Copy the data<o
></o
>
<o
></o
>
Sheets("Timesheet").Range("A12",Range("A12").End(xlDown)).Copy
Is this correct?
Many thanks in advance.
K