Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default copy rows to new page

Hello all,
I have a spreadsheet with value's of OPEN and CLOSED in Column C.
How can I create a macro that will move the rows (Columns A thru F) with
OPEN in column C to the OPEN tab and the rows with CLOSED to the CLOSED tab?

Any assistance is appreciated. I'm familar with VBA in Access, but not very
familar with code in Excel.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default copy rows to new page

Hi david,

Make sure to test and to adjust as needed ...

Sub Macro1()

Dim i As Integer
Dim LastRow As Integer

LastRow = Cells(Cells.Rows.Count, "C").End(xlUp).Row
For i = 1 To LastRow
Range("C" & i).Select
If ActiveCell.Value = "OPEN" Then
ActiveCell.EntireRow.Copy
Sheets("OPEN").Select
Range("A1").Select
If Range("A1").Value < "" Then
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Else
ActiveSheet.Paste
End If
Range("C" & i).Select
Sheets("DATA").Select
Range("C" & i).Select
ElseIf ActiveCell.Value = "CLOSE" Then
ActiveCell.EntireRow.Copy
Sheets("CLOSE").Select
Range("A1").Select
If Range("A1").Value < "" Then
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Else
ActiveSheet.Paste
End If
Range("C" & i).Select
Sheets("DATA").Select
Range("C" & i).Select
End If
Application.CutCopyMode = xlCut
Next i
End Sub

HTH
Cheers
Carim

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
Page Protection interfering with Hiding Rows [email protected] Excel Worksheet Functions 3 August 3rd 06 02:38 PM
Copy formula with skipping rows Fewebber Excel Worksheet Functions 0 June 6th 06 04:12 PM
Conditional page break if merged rows won't fit on the page. zbprtal Excel Worksheet Functions 1 April 12th 06 08:53 PM
how dio i copy page setup formats from 1 spreadsheet to another? mike New Users to Excel 1 September 21st 05 10:27 PM
How can I print noncontiguous rows on the same page? Mary A Walthall Excel Discussion (Misc queries) 1 April 26th 05 10:00 AM


All times are GMT +1. The time now is 11:04 AM.

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"