Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
extracting IF
Maybe something like:
Option Explicit Sub testme99() Dim fWks As Worksheet 'From Dim tWks As Worksheet 'To Dim destRow As Long Dim iRow As Long Dim FirstRow As Long Dim LastRow As Long Dim LastCol As Long LastCol = 255 '= IV really the last column?? Set fWks = Workbooks("book1.xls").Worksheets("sheet1") Set tWks = Workbooks("book2.xls").Worksheets("sheet1") 'different workbook With tWks destRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1 End With With fWks FirstRow = 2 'header row in 1??? LastRow = .Cells(.Rows.Count, LastCol).End(xlUp).Row For iRow = FirstRow To LastRow If .Cells(iRow, LastCol).Value < "" Then tWks.Cells(destRow, 1).Resize(1, LastCol).Value _ = .Cells(iRow, 1).Resize(1, LastCol).Value destRow = destRow + 1 End If Next iRow End With End Sub martyn wrote: If need to extract a row of information to another file or workbook but only if the last column of that row is populated. Im new to VBA so some sample code would be excellent! Many thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extracting Emails f | Excel Discussion (Misc queries) | |||
Extracting First Name | New Users to Excel | |||
extracting last name | Excel Worksheet Functions | |||
extracting dd from dd/mm/yy | Excel Worksheet Functions | |||
extracting IF | Excel Programming |