I'm having an issue with trying to copy data from one worksheet to another.

I have Combo Boxes that has lists from my sheet heading. I then use the sheet heading s to determine which columns to copy to the new sheet according to the combo box values. It works while editing the form but as soon as i save, close, and open it it complains about "Object variable or with block variable not set"

```
Public Sub ExportButton_Click()
    If FileNameTxt.Value = "" Then
        MsgBox "Please choose a file name"
        WinOSBtn.Value = False
        ExportButton.Locked = True
        ExportButton.BackColor = RGB(250, 250, 250)
        ExportButton.ForeColor = RGB(220, 220, 220)
        FileNameTxt.SetFocus
    Else
        ExportButton.Locked = False
        ExportButton.BackColor = RGB(241, 241, 241)
        ExportButton.ForeColor = RGB(0, 0, 0)
    End If

    Dim historyWks As Worksheet
    Dim newWB As Workbook
    Set historyWks = Worksheets("NameList")

     'Create ranges for each ComboBox
    Dim CBA   As Range
    Set CBA = Range("A1:AM1").Find(ComboBoxA.Value)
    Dim CBB   As Range
    Set CBB = Range("A1:AM1").Find(ComboBoxB.Value)
    Dim CBC   As Range
    Set CBC = Range("A1:AM1").Find(ComboBoxC.Value)
    Dim CBD   As Range
    Set CBD = Range("A1:AM1").Find(ComboBoxD.Value)
    Dim CBE   As Range
    Set CBE = Range("A1:AM1").Find(ComboBoxE.Value)
    Dim CBF   As Range
    Set CBF = Range("A1:AM1").Find(ComboBoxF.Value)
    Dim CBG   As Range
    Set CBG = Range("A1:AM1").Find(ComboBoxG.Value)
    Dim CBH   As Range
    Set CBH = Range("A1:AM1").Find(ComboBoxH.Value)
    Dim CBI   As Range
    Set CBI = Range("A1:AM1").Find(ComboBoxI.Value)
    Dim CBJ   As Range
    Set CBJ = Range("A1:AM1").Find(ComboBoxJ.Value)
    Dim CBK   As Range
    Set CBK = Range("A1:AM1").Find(ComboBoxK.Value)
    Dim CBL   As Range
    Set CBL = Range("A1:AM1").Find(ComboBoxL.Value)
    Dim CBM   As Range
    Set CBM = Range("A1:AM1").Find(ComboBoxM.Value)
    Dim CBN   As Range
    Set CBN = Range("A1:AM1").Find(ComboBoxN.Value)
    Dim CBO   As Range
    Set CBO = Range("A1:AM1").Find(ComboBoxO.Value)
    Dim CBP   As Range
    Set CBP = Range("A1:AM1").Find(ComboBoxP.Value)
    Dim CBQ   As Range
    Set CBQ = Range("A1:AM1").Find(ComboBoxQ.Value)
    Dim CBR   As Range
    Set CBR = Range("A1:AM1").Find(ComboBoxR.Value)
    Dim CBS   As Range
    Set CBS = Range("A1:AM1").Find(ComboBoxS.Value)
    Dim CBT   As Range
    Set CBT = Range("A1:AM1").Find(ComboBoxT.Value)
    Dim CBU   As Range
    Set CBU = Range("A1:AM1").Find(ComboBoxU.Value)

     'Prompts for a file name
    If FileNameTxt.Value = "" Then
        MsgBox "Please choose a file name"
    Else

         'Add a new workbook with a file name
        Workbooks.Add
        ActiveWorkbook.SaveAs Filename:=FileNameTxt.Value & ".xls"
         'ActiveWorkbook.Close
        Workbooks.Open (FileNameTxt.Value & ".xls")
        Set newWB = Workbooks(FileNameTxt.Value & ".xls")

        historyWks.Activate
        With historyWks

            If ComboBoxA <> "" Then
                Range(CBA, CBA.End(xlDown)).Copy '***The error starts here and indecates that CBA=Nothing
                                                 'CBA.End(xlDown)=Object variable* or With block variable not set
                newWB.Sheets("Sheet1").Range("A1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("A1").PasteSpecial xlPasteValues
            End If

            If ComboBoxB <> "" Then
                Range(CBB, CBB.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("B1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("B1").PasteSpecial xlPasteValues
            End If
            If ComboBoxC <> "" Then
                Range(CBC, CBC.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("C1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("C1").PasteSpecial xlPasteValues
            End If
            If ComboBoxD <> "" Then
                Range(CBD, CBD.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("D1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("D1").PasteSpecial xlPasteValues
            End If
            If ComboBoxE <> "" Then
                Range(CBE, CBE.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("E1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("E1").PasteSpecial xlPasteValues
            End If
            If ComboBoxF <> "" Then
                Range(CBF, CBF.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("F1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("F1").PasteSpecial xlPasteValues
            End If
            If ComboBoxG <> "" Then
                Range(CBG, CBG.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("G1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("G1").PasteSpecial xlPasteValues
            End If
            If ComboBoxH <> "" Then
                Range(CBH, CBH.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("H1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("H1").PasteSpecial xlPasteValues
            End If
            If ComboBoxI <> "" Then
                Range(CBI, CBI.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("I1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("I1").PasteSpecial xlPasteValues
            End If
            If ComboBoxJ <> "" Then
                Range(CBJ, CBJ.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("J1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("J1").PasteSpecial xlPasteValues
            End If
            If ComboBoxK <> "" Then
                Range(CBK, CBK.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("K1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("K1").PasteSpecial xlPasteValues
            End If
            If ComboBoxL <> "" Then
                Range(CBL, CBL.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("L1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("L1").PasteSpecial xlPasteValues
            End If
            If ComboBoxM <> "" Then
                Range(CBM, CBM.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("M1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("M1").PasteSpecial xlPasteValues
            End If
            If ComboBoxN <> "" Then
                Range(CBN, CBN.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("N1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("N1").PasteSpecial xlPasteValues
            End If
            If ComboBoxO <> "" Then
                Range(CBO, CBO.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("O1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("O1").PasteSpecial xlPasteValues
            End If
            If ComboBoxP <> "" Then
                Range(CBP, CBP.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("P1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("P1").PasteSpecial xlPasteValues
            End If
            If ComboBoxQ <> "" Then
                Range(CBQ, CBQ.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("Q1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("Q1").PasteSpecial xlPasteValues
            End If
            If ComboBoxR <> "" Then
                Range(CBR, CBR.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("R1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("R1").PasteSpecial xlPasteValues
            End If
            If ComboBoxS <> "" Then
                Range(CBS, CBS.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("S1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("S1").PasteSpecial xlPasteValues
            End If
            If ComboBoxT <> "" Then
                Range(CBT, CBT.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("T1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("T1").PasteSpecial xlPasteValues
            End If
            If ComboBoxU <> "" Then
                Range(CBU, CBU.End(xlDown)).Copy
                newWB.Sheets("Sheet1").Range("U1").PasteSpecial xlPasteAll
                newWB.Sheets("Sheet1").Range("U1").PasteSpecial xlPasteValues
            End If
        End With

    End If

    ExportForm.Hide

    Dim i     As Long

    i = MsgBox("Export another?", vbOKCancel)
    If i = vbOK Then
        ExportForm.Show
        If i = vbCancel Then Unload ExportForm
    End If
End Sub

```

I have been searching through the forums but i'm still struggling. I'm sure that there is a smarter way to do all of this, but i'll get there. Any help with getting the error sorted out will be so great!