I am trying to Loop though a list of a data. For every column where L is left blank,
I need to copy column A:K of that row to a second workbook.
I know in need to make the range to be copied and where it should go on the second workbook dynamic.
But I am struggling with getting to work. Below is a copy what i have done.
I need to copy column A:K of that row to a second workbook.
I know in need to make the range to be copied and where it should go on the second workbook dynamic.
But I am struggling with getting to work. Below is a copy what i have done.
Code:
Option Explicit
Sub CopyToViewingWB()
Dim RowNum As Long
RowNum = 3
Workbooks.Open Filename:="M:\HSS Shared Services\Shared Services Team\Chuck T HSS\Recruiting\Req_veiwing_Form.xlsx" 'Location of workbooK
Workbooks("Req_veiwing_Form.xlsx").Sheets("Master").Range("A2:K1000").ClearContents ' Clear workbook for new content
Do Until Cells(RowNum, 1).Value = "" 'This "Workbook Recruiting Info.xlsm"
If Sheet1.Cells(RowNum, 12) = "" Then
Workbooks("Req_veiwing_Form.xlsx").Sheets("Master").Range("A2:K2") = Sheet1.Range("A3:K3").Value 'dynamic range for all Column L's Left emtpy
End If
RowNum = RowNum + 1
Loop
Workbooks("Req_veiwing_Form.xlsx").Save
Workbooks("Req_veiwing_Form.xlsx").Close
End Sub