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
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