Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete a column when it says cannot shift objects off she Justin Phillips New Users to Excel 2 October 17th 06 06:00 PM
shift formulas to the next column bill gras Excel Programming 0 June 23rd 06 01:12 PM
getting cells to shift to next column confusedteacher Excel Discussion (Misc queries) 3 May 2nd 06 10:36 PM
VSTO column insert shift to right Bob Sullentrup Excel Programming 2 November 2nd 05 08:05 PM
How do I shift cells down in a column lillysmom Excel Discussion (Misc queries) 6 August 13th 05 05:51 PM


All times are GMT +1. The time now is 06:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"