Hi All,
I have the following running on inserted check boxes, which I'm mostly happy with. The issue I have is the values paste to sheet 2 and override the previous values.
I need the values to paste in the next free empty row on sheet2, there may be others rows in sheet2 with values that need to remain. But I need this to look and paste in the next free empty row.
Here is the example, I will have around 30 check boxes through the sheet
Sub T2_Click()
Dim LastRow1 As Long
Dim LastRow As Long
Dim LastCol As Long
Dim sh As Worksheet
Set sh = Sheets("Sheet1")
LastCol = Sheets("Sheet1").Cells(1, Columns.Count).End(xlToLeft).Column
LastRow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
LastRow1 = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row
Range(sh.Cells(2, 1), sh.Cells(2, "Q")).Copy Destination:=Sheets("Sheet2").Range("A" & LastRow1 + 1)
Range(sh.Cells(2, 1), sh.Cells(2, "P")).ClearContents
End Sub
Sub T3_Click()
Dim LastRow1 As Long
Dim LastRow As Long
Dim LastCol As Long
Dim sh As Worksheet
Set sh = Sheets("Sheet1")
LastCol = Sheets("Sheet1").Cells(1, Columns.Count).End(xlToLeft).Column
LastRow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
LastRow1 = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row
Range(sh.Cells(2, 1), sh.Cells(3, "Q")).Copy Destination:=Sheets("Sheet2").Range("A" & LastRow1 + 1)
Range(sh.Cells(2, 1), sh.Cells(3, "P")).ClearContents
End Sub
Thanks!!!
I have the following running on inserted check boxes, which I'm mostly happy with. The issue I have is the values paste to sheet 2 and override the previous values.
I need the values to paste in the next free empty row on sheet2, there may be others rows in sheet2 with values that need to remain. But I need this to look and paste in the next free empty row.
Here is the example, I will have around 30 check boxes through the sheet
Sub T2_Click()
Dim LastRow1 As Long
Dim LastRow As Long
Dim LastCol As Long
Dim sh As Worksheet
Set sh = Sheets("Sheet1")
LastCol = Sheets("Sheet1").Cells(1, Columns.Count).End(xlToLeft).Column
LastRow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
LastRow1 = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row
Range(sh.Cells(2, 1), sh.Cells(2, "Q")).Copy Destination:=Sheets("Sheet2").Range("A" & LastRow1 + 1)
Range(sh.Cells(2, 1), sh.Cells(2, "P")).ClearContents
End Sub
Sub T3_Click()
Dim LastRow1 As Long
Dim LastRow As Long
Dim LastCol As Long
Dim sh As Worksheet
Set sh = Sheets("Sheet1")
LastCol = Sheets("Sheet1").Cells(1, Columns.Count).End(xlToLeft).Column
LastRow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
LastRow1 = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row
Range(sh.Cells(2, 1), sh.Cells(3, "Q")).Copy Destination:=Sheets("Sheet2").Range("A" & LastRow1 + 1)
Range(sh.Cells(2, 1), sh.Cells(3, "P")).ClearContents
End Sub
Thanks!!!