Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-25-2014, 11:55 PM
visha_1984 visha_1984 is offline Excel copy two numbers between specific column and paste in next sheet Windows 7 32bit Excel copy two numbers between specific column and paste in next sheet Office 2010 32bit
Novice
Excel copy two numbers between specific column and paste in next sheet
 
Join Date: Jan 2013
Posts: 3
visha_1984 is on a distinguished road
Default Excel copy two numbers between specific column and paste in next sheet




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
Attached Files
File Type: xlsx Temp.xlsx (15.3 KB, 9 views)
Reply With Quote
  #2  
Old 12-26-2014, 07:59 PM
Bruno Campanini Bruno Campanini is offline Excel copy two numbers between specific column and paste in next sheet Windows 8 Excel copy two numbers between specific column and paste in next sheet 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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to change Macro to copy and paste data to new sheet Vortex69 Excel Programming 0 12-23-2014 09:53 PM
how can i split a column of rows in half without copy and paste.. Lindseyfparker Excel 2 04-25-2014 12:52 AM
Excel copy two numbers between specific column and paste in next sheet Browse to a specific sheet in an excel workbook Sinister Excel 4 04-08-2014 05:53 PM
Excel copy two numbers between specific column and paste in next sheet Find specific rows then copy and paste to new doc konopca Word VBA 5 02-20-2014 02:34 PM
How to Copy data from Outlook mail and Paste it in a Excel sheet? padhu1989 Outlook 0 09-11-2012 04:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft