View Single Post
 
Old 12-26-2014, 07:59 PM
Bruno Campanini Bruno Campanini is offline Windows 8 Office 2013
Novice
 
Join Date: Nov 2014
Posts: 19
Bruno Campanini is on a distinguished road
Default

Quote:
Originally Posted by visha_1984 View Post
Hi, Friends

I have a workbook with huge data and find out blank row in col Gwith specific row, I have attached sample file with input and output..
Any help much appreciate.
Thanks in advance

Code:
 
Public Sub SpecialCopy()
Dim SourceRange As Range, TargetRange As Range
Dim StartCell As Range, i, k As Long
'---  Definitions  -----------
Set StartCell = [INPUT!A2]
Set TargetRange = [OUTPUT!G2]
'-----------------------------
Set SourceRange = [INPUT!A:A]
Set SourceRange = Range(StartCell, SourceRange(SourceRange.Rows.Count).End(xlUp))
For Each i In SourceRange
    If i(1, 7) = 0 Then
        k = k + 1
        TargetRange(k) = i(1, 4)
    End If
Next
End Sub
I think a few lines of code are better than a huge amount of formulas...

Bruno
Attached Files
File Type: xlsm Temp.xlsm (22.6 KB, 9 views)
Reply With Quote