PC Review


Reply
Thread Tools Rate Thread

Copying selected rows to a new workbook

 
 
Jeffrey Marks
Guest
Posts: n/a
 
      27th Jul 2011
I'm trying to look at all rows in a worksheet. If the value in column C has the word case in it, I want to copy it to a new workbook.

The macro does create a new workbook, but nothing gets copied over. I could use some help. Thanks!

Jeff

Sub JustcaseWorkbook()
'
' JustcaseWorkbook Macro

Dim i As Integer, shName As String
Dim rowData As Range, rowXAxis As Range
Dim chtTitle As Range
Workbooks.Add
Windows("LABELINVENTORY7-20-2011 (1).xls").Activate
'
shName = "Sheet1"
Set rowData = Sheets(shName).Range("a5:c5")
For i = 5 To 194

If Range("A" & i).Value Like "*case*" Then
ActiveSheet.Range(Cells(1, i), Cells(3, i)).Select
Selection.Copy
Windows("Book2").Activate
Range("A" & i).Select
ActiveSheet.Paste
Windows("LABELINVENTORY7-20-2011 (1).xls").Activate
End If
Next i
Windows("LABELINVENTORY7-20-2011 (1).xls").Activate
Sheets(shName).Activate
Range("a1").Activate
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying selected rows into new worksheet PVANS Microsoft Excel Programming 2 31st Jul 2009 04:04 PM
Copying range from selected workbook to open workbook John Microsoft Excel Programming 2 11th Aug 2007 03:49 PM
Copying Selected Rows From Workbook1 to WorkBook2 seanswilson@gmail.com Microsoft Excel Misc 0 10th Oct 2006 11:27 PM
Copying Selected Rows From Workbook1 to WorkBook2 seanswilson@gmail.com Microsoft Excel Misc 0 10th Oct 2006 11:24 PM
Copying selected rows to another sheet tacarme Microsoft Excel Worksheet Functions 3 25th Jun 2005 11:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:33 AM.