V
Vix
I have a workbook containing two sheets.
On sheet1 named 'Entry', all the details of overtime are entered.
When the details of that days overtime are entered, the macro is run which
transfers the info into row3 of sheet2, which is named 'Form'
This works fine, apart from the next time any overtime info is added and the
macro is run, the info goes into row3 again.
I am not sure how to go down into the next row??
The code is shown below.
Sub Overtime()
Sheets("Entry").Select
Range("D4").Select
Selection.Copy
Range("C23").Select
Sheets("Form").Select
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A10:A13").Select
Sheets("Entry").Select
Range("D68").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Form").Select
Range("B44").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("C44").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "5:30:00 PM"
Range("C4").Select
ActiveCell.FormulaR1C1 = "=ROUND(((Entry!R[3]C[1])/""0:15""),0)*""0:15"""
Range("D4").Select
ActiveCell.FormulaR1C1 = "=ROUND(((Entry!R[4]C)/""0:15""),0)*""0:15"""
Range("E4").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"
Range("E4").Select
Selection.NumberFormat = "h.mm"
Sheets("Entry").Select
Range("D1012").Select
Selection.Copy
Sheets("Form").Select
Range("F4:H4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("A5").Select
End Sub
On sheet1 named 'Entry', all the details of overtime are entered.
When the details of that days overtime are entered, the macro is run which
transfers the info into row3 of sheet2, which is named 'Form'
This works fine, apart from the next time any overtime info is added and the
macro is run, the info goes into row3 again.
I am not sure how to go down into the next row??
The code is shown below.
Sub Overtime()
Sheets("Entry").Select
Range("D4").Select
Selection.Copy
Range("C23").Select
Sheets("Form").Select
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A10:A13").Select
Sheets("Entry").Select
Range("D68").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Form").Select
Range("B44").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("C44").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "5:30:00 PM"
Range("C4").Select
ActiveCell.FormulaR1C1 = "=ROUND(((Entry!R[3]C[1])/""0:15""),0)*""0:15"""
Range("D4").Select
ActiveCell.FormulaR1C1 = "=ROUND(((Entry!R[4]C)/""0:15""),0)*""0:15"""
Range("E4").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"
Range("E4").Select
Selection.NumberFormat = "h.mm"
Sheets("Entry").Select
Range("D1012").Select
Selection.Copy
Sheets("Form").Select
Range("F4:H4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
Range("A5").Select
End Sub