Forum Discussion
OJBridger
May 24, 2022Copper Contributor
VBA Code to write cell values to another sheet
Hi! I have the below VBA code that takes cell values from rows B5:U5, and then writes a copy of that data to another set of columns to store a 'history' (these figures then get updated from a que...
- May 24, 2022
Try
Public Sub ButtonOnClick() Application.EnableEvents = False With Worksheets("History") .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(, 20).Value = Me.Range("B5:U5").Value End With Application.EnableEvents = True End Sub
HansVogelaar
May 24, 2022MVP
Try
Public Sub ButtonOnClick()
Application.EnableEvents = False
With Worksheets("History")
.Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(, 20).Value = Me.Range("B5:U5").Value
End With
Application.EnableEvents = True
End Sub