i would like to select a copy range from active workbook and sheet from "A2" to last populated cell in column "G"
then close this workbook. open a new workbook "workbook2" sheet "sheet1" and paste to first unpopulated row, save and close workbook
i would like to select a copy range from active workbook and sheet from "A2" to last populated cell in column "G"
then close this workbook. open a new workbook "workbook2" sheet "sheet1" and paste to first unpopulated row, save and close workbook
Hello johncarr1952,
Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Try this:
I also atached an example file with this code![]()
Sub example() last_row_G = Sheets(1).Cells(Rows.Count, "G").End(xlUp).Row last_cell = "G" & last_row_G Sheets(1).Range("A2:" & last_cell).Copy Workbooks.Add Sheets(1).Paste ThisWorkbook.Save ActiveWorkbook.Close End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks