Exporting Only Filled Rows To Another Workbook (revised)
Hi Guys,
Can one of you pls help me to update below code to export the data to below path. Path= C:\FebTest.xls Sheet=Data Sub CopyFilledRows() ' Copies the contents of each non-empty row in a range, ' to another location with no empty rows. Dim RangeToExport As Range, r As Object Dim lRow As Long, lTargetRow As Long Set RangeToExport = ActiveSheet.Range("$A$1:$C$6") lRow = RangeToExport.Rows(1).Row lTargetRow = 1 With RangeToExport For Each r In .Rows If Application.WorksheetFunction.CountA(.Rows(lRow)) 0 Then .Rows(lRow).Copy Destination:=ActiveSheet.Range("$E$" & lTargetRow) lTargetRow = lTargetRow + 1 End If lRow = lRow + 1 Next End With End Sub Thanks for all support! Kindest Regards, Cuneyt KUYUMCU |
Exporting Only Filled Rows To Another Workbook (revised)
Hi Cuneyt,
I posted a revised solution in your previous thread earlier today. (currently 2 pages further back) Regards, GS |
All times are GMT +1. The time now is 08:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com