<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> Hi all,</o>
<o> </o>
I want to loop through each row of a spreadsheet and based on the value of cells in column b, copy the contents of the cells in columns a,b , d, h, j, and copy it to another workbook. I have it working where I can copy the entire row but that won't work for my current project. Here is the code to get the entire row:
Sub copyRows_1()
Dim SiteCol As Range, Cell As Object
Set SiteCol = Range("B4:B700") 'Range containing pc names
For Each Cell In SiteCol
If IsEmpty(Cell) Then
Exit Sub
End If
If Cell.Value Like "PC00*" Then
Cell.EntireRow.Copy
Windows("pcMaster.xls").Activate
ActiveSheet.Range("A65536").End(xlUp).Select
Selection.Offset(1, 0).Select
ActiveSheet.Paste
End If
Next
End Sub
Thanks in Advance.
<o> </o>
I want to loop through each row of a spreadsheet and based on the value of cells in column b, copy the contents of the cells in columns a,b , d, h, j, and copy it to another workbook. I have it working where I can copy the entire row but that won't work for my current project. Here is the code to get the entire row:
Sub copyRows_1()
Dim SiteCol As Range, Cell As Object
Set SiteCol = Range("B4:B700") 'Range containing pc names
For Each Cell In SiteCol
If IsEmpty(Cell) Then
Exit Sub
End If
If Cell.Value Like "PC00*" Then
Cell.EntireRow.Copy
Windows("pcMaster.xls").Activate
ActiveSheet.Range("A65536").End(xlUp).Select
Selection.Offset(1, 0).Select
ActiveSheet.Paste
End If
Next
End Sub
Thanks in Advance.