I have a specific need to copy cells from one sheet to another sheet whereby not the entire row is copied. Only data in specific columns in the one sheet needs to be copied to specific columns in the other sheet. Copying does not happen row by row but cell by cell and not in the same order as presented in either sheet . E.g. Copy ROW "A" in Sheet 1 to ROW "D" in Sheet 2.
The code I have here works great except I would like to ONLY copy cells in rows WITH DATA and SKIP the rows with BLANK cells. I would like some help adding a line of code that precedes the copy-functions ("D" to "X", "O" to "Z", etc.) to skip the rows with blank cells.
Sub Test()
Dim i As Long
Dim ii As Long
Dim i3 As Long
Dim LastRow As Long
Dim wb As Workbook
Dim sht1 As Worksheet
Dim sht2 As Worksheet
Set wb = ThisWorkbook
Set sht1 = wb.Sheets("DataValues")
Set sht2 = wb.Sheets("BEN")
Sheets("BEN").Select
Range("C192:P220").ClearContents
'Find the last row (in column X) with data in sheet ("DATAValues"). (LIMIT data to COLUMN Z)
LastRow = sht1.Range("Z9:Z37").Find("*", SearchDirection:=xlPrevious).Row
'Start copying data values in "BEN" starting at ROW "192" (due to other data located above)
ii = 192
'This is the beginning of the loop !!!
'Start at row 9 in DATAVALUES to last row with data
For i = 9 To LastRow
'First activity
'This is a MUST HAVE for my application
sht2.Range("D" & ii) = sht1.Range("X" & i).Value
sht2.Range("O" & ii) = sht1.Range("Z" & i).Value
sht2.Range("K" & ii) = sht1.Range("AB" & i).Value
sht2.Range("M" & ii) = sht1.Range("AD" & i).Value
ii = ii + 1
Next i
End Sub