Hi this is really starting to annoy me now. Everytime I try to select a column in VBA I get runtime error 1004 "Select method of range class faailed" I'm sure I'm just being an idiot but nothing seems work. I've tried different versions of the same thing but they don't work. Am i doing something really stupid? I've included my code just in case. Thanks.

Private Sub CB_Bakery_Click()

Dim wsM As Worksheet, wsM2 As Worksheet
Dim LRow2 As String

'sets the variables wsM equal to Main worksheet and wsM2 equal to Main2
Set wsM = Sheets("Main")
Set wsM2 = Sheets("Main2")

'sets variable LRow2 equal to the last row in column A of the
'activesheet that contains data
LRow2 = ActiveSheet.Range("A65535").End(xlUp).Row

'select the Main worksheet
wsM.Select

'select all the cells
wsM.UsedRange.Select
   'autofilter and copy to wsM2
   Selection.AutoFilter Field:=3, Criteria1:="Bakery"
   wsM.Columns("b:b").Copy wsM2.Range("a1")
   wsM.Columns("d:d").Copy wsM2.Range("b1")
   wsM.Columns("f:f").Copy wsM2.Range("c1")
   wsM.Columns("q:q").Copy wsM2.Range("e1")
   wsM.Columns("r:r").Copy wsM2.Range("f1")
   wsM.Columns("g:g").Copy wsM2.Range("g1")
   wsM.Columns("bm:bm").Copy wsM2.Range("h1")
   wsM.Columns("bn:bn").Copy wsM2.Range("i1")
   wsM.Columns("bo:bo").Copy wsM2.Range("j1")
   wsM.Columns("bp:bp").Copy wsM2.Range("k1")
    
'select Main2 worksheet
wsM2.Select


    
    'put a value in column D cell D1
    wsM2.Range("D1").Value = "Due"
        'value in D2 equal to the formula
        wsM2.Range("D2").Value = "=c2-(TODAY()-182)"
        'copy the formula
        wsM2.Range("D3").Copy
        'paste it into the remaining cells for the column up until the last row
        ActiveSheet.Range("D4:D" & LRow2).Select
        Selection.PasteSpecial
        Application.CutCopyMode = Fallse
        
    
'set conditional formating THE NEXT LINE CAUSES THE ERROR
    Columns("D:D").Select
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
        Formula1:="30"
    Selection.FormatConditions(1).Font.ColorIndex = 2
    Selection.FormatConditions(1).Interior.ColorIndex = 2
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
        Formula1:="1", Formula2:="30"
    Selection.FormatConditions(2).Font.ColorIndex = 2
    Selection.FormatConditions(2).Interior.ColorIndex = 37
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
        Formula1:="=TODAY()-182"
    Selection.FormatConditions(3).Font.ColorIndex = 2
    Selection.FormatConditions(3).Interior.ColorIndex = 9
    
wsM2.Select
'set widths
    Columns("A:A").ColumnWidth = 15
    Columns("B:B").ColumnWidth = 12
    Columns("C:C").ColumnWidth = 7
    Columns("D:D").ColumnWidth = 4
    Columns("E:E").ColumnWidth = 7
    Columns("F:F").ColumnWidth = 7
    Columns("F:F").EntireColumn.AutoFit
    
End Sub