Hi I have a code:
Private Sub CommandButton18_Click()
Dim src As Worksheet
Dim tgt As Worksheet
Dim filterRange As Range
Dim copyRange As Range
Dim lastRow As Long
Set src = ThisWorkbook.Sheets("TOTALS")
Set tgt = ThisWorkbook.Sheets("CUSTOM MAX REPORT ")
' turn off any autofilters that are already set
src.AutoFilterMode = False
' find the last row with data in column I
lastRow = src.Range("I" & src.Rows.Count).End(xlUp).Row
' the range that we are auto-filtering (all columns)
Set filterRange = src.Range("I3:I" & 152)
' the range we want to copy (only columns we want to copy)
' in this case we are copying country from column A
' we set the range to start in row 2 to prevent copying the header
Set copyRange = src.Range("I3:I" & 152)
It copies a cell from sheet 1 into a cell in sheet 2, however I need it to copy the whole row (and place it into the appropriate columns (the columns match the first sheet)). What should I change?
Thank you for your help
Moderators note: code tags added for you - this time
Bookmarks