Hi All,
I am having an issue with my VBA/Macro
I'm trying to copy 5 cell contents to a different sheet
I've managed to input data to a fixed cell range and it'll insert it at the bottom of data
but I need to do it based on selected cells.
so basically 09:15;J Jack Bob; H23456; DUU and YY should be copied and pasted into this:
This is what i'm trying to do - but it doesn't work
Does anyone have any tips/pointers to show where i am going wrong?
Many thanks in advance
I am having an issue with my VBA/Macro
I'm trying to copy 5 cell contents to a different sheet
I've managed to input data to a fixed cell range and it'll insert it at the bottom of data
but I need to do it based on selected cells.
so basically 09:15;J Jack Bob; H23456; DUU and YY should be copied and pasted into this:
VBA Code:
Sub CopyName()
Worksheets("JohnSmith").Range("A" & Rows.Count).End(xlUp).Offset(0, 0) = Worksheets("Diary").Range(ActiveCell.Offset(0, -1)).Value 'date
Worksheets("JohnSmith").Range("B" & Rows.Count).End(xlUp).Offset(1, 1) = Worksheets("Diary").Range(ActiveCell.Offset(0, 0)).Value 'name
Worksheets("JohnSmith").Range("C" & Rows.Count).End(xlUp).Offset(1, 1) = Worksheets("Diary").Range(ActiveCell.Offset(1, 0)).Value
Worksheets("JohnSmith").Range("D" & Rows.Count).End(xlUp).Offset(1, 1) = Worksheets("Diary").Range(ActiveCell.Offset(2, 0)).Value
Worksheets("JohnSmith").Range("E" & Rows.Count).End(xlUp).Offset(1, 1) = Worksheets("Diary").Range(ActiveCell.Offset(3, 0)).Value
Call selectandformat
End Sub
This is what i'm trying to do - but it doesn't work
Does anyone have any tips/pointers to show where i am going wrong?
Many thanks in advance