Hi Forum,
I've recently been tasked with changing a daily process at my work. The general overview is the main tab is filled in daily by some of our operators and then stored in a 'database' as such for each month. However, I'm not that great at VBA
My current code is below
This prints from Sheet "Daily log" and pastes into "Data". The code currently works super fast, however, I'm stumped as to how I can get my code to shift to the next column in Sheet "Data" ready for the next day. I've seen a few ideas online but none seem to work.
Can someone point me in the right direction? I'm enjoying learning VBA at the moment, so would rather not be spoon fed - unless of course it does get complicated!
Thanks in advance,
Ross
I've recently been tasked with changing a daily process at my work. The general overview is the main tab is filled in daily by some of our operators and then stored in a 'database' as such for each month. However, I'm not that great at VBA
My current code is below
Code:
Sub copier()
Dim data As WorksheetDim Lastcolumn As Long
Set wb = ThisWorkbook
Set sht1 = wb.Sheets("Daily log")
Set Sht2 = wb.Sheets("Data")
Set sht3 = wb.Sheets("Shift Reports")
Lastrow = sht1.Range("G5:G43").Find("*", searchdirection:=xlPrevious).Row
ii = 3
For i = 5 To Lastrow
Sht2.Range("B" & ii) = sht1.Range("G" & i).Value
ii = ii + 1
Next i
sht1.Range("G5:G43").ClearContents
MsgBox "Input data copied and entries cleared for next day"
This prints from Sheet "Daily log" and pastes into "Data". The code currently works super fast, however, I'm stumped as to how I can get my code to shift to the next column in Sheet "Data" ready for the next day. I've seen a few ideas online but none seem to work.
Can someone point me in the right direction? I'm enjoying learning VBA at the moment, so would rather not be spoon fed - unless of course it does get complicated!
Thanks in advance,
Ross