Most valuable professional
  • Hot Topics

Excel Copy Data to new Worksheet Based on Column Value

I have a worksheet called Master Table with columns A-CR. The Column I am searching is in column B. In the same workbook I have a spreadsheet called SearchMasterTable I am using cell C1 in this workbook for the input of the requested lookup. If the data in SearchMasterTable cell C1 equals one or multiple records in workbook Master Table column B, I am trying to copy these records to the workbook SearchMasterTable starting with row 6. The code runs but is not copying the data to the new worksheet. Code: Sub finddata() Dim ApplicationNumber As String Dim finalrow As Integer Dim i As Integer Dim LastRow As Long Sheets("SearchMasterTable").Range("A6:CR506").ClearContents ApplicationNumber finalrow For i = 2 To finalrow If Cells(i, 2) = ApplicationNumber Then 'Sheets("Master Table").Range(Cells(i, 1), Cells(i, 96)).Copy 'Sheets("SearchMasterTable").Range("A6").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats Application.ScreenUpdating = False

This question generated 12 answers. To proceed to the answers, click here.

This thread is current as of February 13, 2018.

For more resources for Microsoft Excel:

This article includes the following tags:

  • Excel
  • Microsoft Excel