I am trying to create a macro that will copy the rows in a 24 row table that contain data (but not the rows with only an IF formula giving "" as the FALSE value) and copy them to another workbook in a table after looking for the next blank row. On running the macro for a second time, it considers the blank rows in the receiving table to have an empty string, so pastes the values below the empty / blank rows rather than in the next row below the actual cell values (numeric, general and date)
Grateful if you could check my VBA and amend to ignore the rows with the empty strings ("")
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
'Set variables for copy and destination sheets
Set wsCopy = Workbooks("Book1.xlsm").Worksheets("Database Transfer")
Set wsDest = Workbooks("Book2.xlsx").Worksheets("2021")
'1. Find last used row in the copy range based on data in column A
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row
'2. Find first blank row in the destination range based on data in column A
'Offset property moves down 1 row
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row
'3. Copy & Paste Data
wsCopy.Range("A2:V" & lCopyLastRow).Copy
wsDest.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlValues
Selection.Value = Selection.Value
Grateful if you could check my VBA and amend to ignore the rows with the empty strings ("")
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
'Set variables for copy and destination sheets
Set wsCopy = Workbooks("Book1.xlsm").Worksheets("Database Transfer")
Set wsDest = Workbooks("Book2.xlsx").Worksheets("2021")
'1. Find last used row in the copy range based on data in column A
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row
'2. Find first blank row in the destination range based on data in column A
'Offset property moves down 1 row
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row
'3. Copy & Paste Data
wsCopy.Range("A2:V" & lCopyLastRow).Copy
wsDest.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlValues
Selection.Value = Selection.Value