Forum Discussion

OJBridger's avatar
OJBridger
Copper Contributor
May 24, 2022
Solved

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...
  • HansVogelaar's avatar
    May 24, 2022

    OJBridger 

    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

Resources