A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Try this version:
Private Sub CommandButton1_Click()
With Sheets("Sheet1")
.Range("A2").Value = .Range("A3").Value + 1
End With
Unload Me
End Sub
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to create a code for the command button in a UserForm I created so when I click the command button the sum of A3 + 1 will show up in A2. What I have created below doesn’t work so well. I don’t want to have any formula in A2, just the number value which is equal to A3 + 1. Can you help?
Private Sub CommandButton1_Click()
With Sheets("Sheet1")
.Range("A2").Value = A3 + 1
Unload Me
End With
End Sub
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Try this version:
Private Sub CommandButton1_Click()
With Sheets("Sheet1")
.Range("A2").Value = .Range("A3").Value + 1
End With
Unload Me
End Sub
This is what I was looking for. Thank you, it is perfect.