Question : VBA code for Excel - copy current row to blank row on new sheet

Hello Experts,

I need some help with a macro I'm trying to create in Excel 2003.  I have a workbook with 2 sheets: Data_Entry and Check_Out.  When the user is on a selected row in the Data_Entry sheet, I want them to be able to click a button called "check out" that will copy the row they are on to the next available blank row in the Check_Out worksheet.

Any and all help would be greatly appreciated.  I'm new to VBA.

Thank you in advance!

Answer : VBA code for Excel - copy current row to blank row on new sheet

Hi Anne,

Please try the following code and see if this works for you...

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
Private Sub CommandButton1_Click()
 
Dim ws1, ws2 As Worksheet
Dim lstrow As Integer
 
Set ws1 = Sheets("Data_Entry")
Set ws2 = Sheets("Check_Out")
 
ActiveCell.EntireRow.Copy
lstrow = ws2.Cells(65536, "A").End(xlUp).Row + 1
ws2.Range(lstrow & ":" & lstrow).PasteSpecial
Application.CutCopyMode = False
 
End Sub
Open in New Window Select All
 
Check Out Button
 
Random Solutions  
 
programming4us programming4us