I am trying to get a macro to copy rows dependent on certain criteria, in this case "FX Ccy Options", for a table of data using column M. I have manged to do this with the below code, but I don't want to copy the entire row (c.EntireRow.copy). Just for all the columns with data (C:X).
Sub Button2_Click()
Dim bottomL As Integer
bottomL = Sheets("DGM").Range("M" & Rows.Count).End(xlUp).Row: x = 1
Dim c As Range
For Each c In Sheets("DGM").Range("M1:M" & bottomL)
If c.Value = "FX Ccy Options" Then
c.EntireRow.Copy Worksheets("sheet2").Range("A" & x + 1)
x = x + 1
End If
Next c
End Sub