Hi,
I am new to vba programming. I have written the following codes. The codes work for Copy and paste, but when I change to Cut and paste, it won't work. I am trying to cut a row on one spreadsheet, and paste the row in another spreadsheet. I can't figure this out. Can someone help me? Thanks
Do While celltxt <> ""
' MsgBox "Celltext =" & celltxt
Set MembersReport = ActiveWorkbook
ActiveWorkbook.Worksheets(1).Activate
ActiveWorkbook.Worksheets(1).Cells(r, "B").EntireRow.Select
Selection.Copy
Workbooks(ProgramReport.Name).Activate
ActiveWorkbook.Worksheets(2).Select
lastRowinProgReportTab2 = ActiveWorkbook.Worksheets(2).Range("B" & Rows.Count).End(xlUp).Row
'Rows(lastRowinProgReportTab2 + 1).Select
ActiveWorkbook.Worksheets(2).Cells(lastRowinProgReportTab2 + 1, "A").Select
ActiveSheet.Paste
r = r + 1
Workbooks(MembersReport.Name).Activate
ActiveWorkbook.Worksheets(1).Activate
celltxt = Cells(r, "B").Value
Cells(r, "B").Select
Loop
I am new to vba programming. I have written the following codes. The codes work for Copy and paste, but when I change to Cut and paste, it won't work. I am trying to cut a row on one spreadsheet, and paste the row in another spreadsheet. I can't figure this out. Can someone help me? Thanks
Do While celltxt <> ""
' MsgBox "Celltext =" & celltxt
Set MembersReport = ActiveWorkbook
ActiveWorkbook.Worksheets(1).Activate
ActiveWorkbook.Worksheets(1).Cells(r, "B").EntireRow.Select
Selection.Copy
Workbooks(ProgramReport.Name).Activate
ActiveWorkbook.Worksheets(2).Select
lastRowinProgReportTab2 = ActiveWorkbook.Worksheets(2).Range("B" & Rows.Count).End(xlUp).Row
'Rows(lastRowinProgReportTab2 + 1).Select
ActiveWorkbook.Worksheets(2).Cells(lastRowinProgReportTab2 + 1, "A").Select
ActiveSheet.Paste
r = r + 1
Workbooks(MembersReport.Name).Activate
ActiveWorkbook.Worksheets(1).Activate
celltxt = Cells(r, "B").Value
Cells(r, "B").Select
Loop