Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming for column shift
Given the routine below, how can I have the macro seach column c of each
worksheet and if there is a numeric value in that cell copy the entire row to another sheet (sheet2) and continue to search ? Sub numbers() Dim ws As Worksheet, cell As Range, rng As Range For Each ws In ThisWorkbook.Worksheets If Not ws.Name = "Sheet2" Then For Each cell In ws.Range("A1:A" & ws.Range("A65536").End(xlUp).Row) If IsNumeric(cell) = True Then cell.EntireRow.Copy _ Sheets("Sheet2").Range("A65536").End(xlUp).Offset( 1, 0) End If Next cell End If Next ws End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming for column shift
..... If IsNumeric(cell.offset(0,2).value) Then ..... The "=True" is not required here. Or just change "A" to "C" in your for loop range. -- Tim Williams Palo Alto, CA "Jerry Foley" wrote in message ... Given the routine below, how can I have the macro seach column c of each worksheet and if there is a numeric value in that cell copy the entire row to another sheet (sheet2) and continue to search ? Sub numbers() Dim ws As Worksheet, cell As Range, rng As Range For Each ws In ThisWorkbook.Worksheets If Not ws.Name = "Sheet2" Then For Each cell In ws.Range("A1:A" & ws.Range("A65536").End(xlUp).Row) If IsNumeric(cell) = True Then cell.EntireRow.Copy _ Sheets("Sheet2").Range("A65536").End(xlUp).Offset( 1, 0) End If Next cell End If Next ws End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I delete a column when it says cannot shift objects off she | New Users to Excel | |||
shift formulas to the next column | Excel Programming | |||
getting cells to shift to next column | Excel Discussion (Misc queries) | |||
VSTO column insert shift to right | Excel Programming | |||
How do I shift cells down in a column | Excel Discussion (Misc queries) |