Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hello, please can you help me with the code below that works great but i just wanted the data in the form to clear once the add button has been pressed and all data has be transferred to the other sheet, is there any way for it to 'Clear' once the button is pressed? please can you help me? thank you again for your time much apprecated, i am a beginner and loving this coding and learning.
Private Sub CommandButton2_Click()
Dim NxtRw As Long
Application.ScreenUpdating = False
NxtRw = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
With Sheets("Northants")
Sheets("Sheet2").Range("A" & NxtRw).Resize(, 8).Value = Application.Transpose(.Range("B22:B29").Value)
Sheets("Sheet2").Range("I" & NxtRw).Value = .Range("C29").Value
Sheets("Sheet2").Range("J" & NxtRw).Resize(, 2).Value = Application.Transpose(.Range("B30:B31").Value)
End With
Application.ScreenUpdating = True
End Sub
Code:
Dim NxtRw As Long
Application.ScreenUpdating = False
NxtRw = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Row
With Sheets("Northants")
Sheets("Sheet2").Range("A" & NxtRw).Resize(, 8).Value = Application.Transpose(.Range("B22:B29").Value)
Sheets("Sheet2").Range("I" & NxtRw).Value = .Range("C29").Value
Sheets("Sheet2").Range("J" & NxtRw).Resize(, 2).Value = Application.Transpose(.Range("B30:B31").Value)
End With
Application.ScreenUpdating = True
End Sub