londonparisrome
New Member
- Joined
- Aug 1, 2019
- Messages
- 25
I am self-taught in VBA, so my apologies if this is an easy question. I am trying to reset data in the first column of a table to "Y". The current table location is rows 16-246, but I would like the user to be able to expand that, as needed, so I need the row numbers to be variable. I was able to create the variable range on the spreadsheet in cell X2, so it contains "(B16:B246)", and it will grow or shrink based on the rows in the table. Is there a way to reference cell X2 in my code for the range, or am I going about it the wrong way?
Private Sub Reset_Click()
' Replace column B with Y
ActiveSheet.Range("B16:B246").Value = "Y"
End Sub
Private Sub Reset_Click()
' Replace column B with Y
ActiveSheet.Range("B16:B246").Value = "Y"
End Sub