Pasting copied cells to column A after determining next empty cell in column F

andymalan

Board Regular
Joined
Feb 22, 2017
Messages
128
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Greetings everyone/anyone.
I have a number of cells that contain data or formulas in columns A to F
I want to find the last non-empty cell in column F, and then paste a copied range into column A of the same row.
The following code is what I have at present, which works fine except that the search for the last non-empty cell seems to be done in column A.


Private Sub Label1_Click()
'Sub PopulateCustomerList()
'
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet


Set copySheet = Worksheets("Users")
Set pasteSheet = Worksheets("InvoiceNumbers")
Application.Goto Reference:="_UserList"
Selection.Copy
Worksheets("InvoiceNumbers").Select
copySheet.Range("_UserList").Copy
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteAll
Application.CutCopyMode = False
Application.ScreenUpdating = True
Sheets("MonthlyInvoices").Select
ActiveCell.FormulaR1C1 = "1"
Label1.Enabled = False
Application.ScreenUpdating = True
End Sub

Any help will be greatly appreciated. Andy Malan
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I want to find the last non-empty cell in column F
You can do that like this:
Code:
Cells(Rows.Count,"F").End(xlUp)
 
Upvote 0

Forum statistics

Threads
1,216,127
Messages
6,129,022
Members
449,481
Latest member
joaotcosta23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top