Hi all, i have a worksheet, which has a changing name, W.E.**. I'd like to copy a range of cells from this worksheet to one named OVERTIME, using a button. I'm at a loss how to refer to the worksheet I'm copying from.
Any help much appreciated. The code below is what I have so far, where ("ABACUS") is the active worksheet i'm copying from.
EDIT:
HI, a bit of an after thought.
On the sheet ("OVERTIME") I'm looking to paste / write over the values into columns B to M, where column A has a value equal to "M2" in the original active worksheet.
Hope this makes some kind of sense.
Thanks
Any help much appreciated. The code below is what I have so far, where ("ABACUS") is the active worksheet i'm copying from.
VBA Code:
Sub Button3_Click()
'copy overtime sunday
With Sheets("ABACUS")
WKend = .Range("M2").Value2
arr = .Range("AI21:AI33").Value
End With
With Sheets("OVERTIME")
' last used row in column B plus 1
writerow = .Range("A" & .Rows.Count).End(xlUp).Row + 1
.Range("A" & writerow) = WKend
.Range("B" & writerow).Resize(, UBound(arr)).Value = Application.Transpose(arr)
End With
End Sub
EDIT:
HI, a bit of an after thought.
On the sheet ("OVERTIME") I'm looking to paste / write over the values into columns B to M, where column A has a value equal to "M2" in the original active worksheet.
Hope this makes some kind of sense.
Thanks
Last edited by a moderator: