Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 12
Default Copying selected rows to a new workbook

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
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
Copying selected data and headings JLY Excel Discussion (Misc queries) 1 July 14th 08 10:37 PM
Copying only selected items to another worksheet firewaterjoe Excel Worksheet Functions 1 January 23rd 08 06:12 PM
Copying Selected Rows From Workbook1 to WorkBook2 [email protected] Excel Discussion (Misc queries) 0 October 10th 06 11:27 PM
Copying Selected Rows From Workbook1 to WorkBook2 [email protected] Excel Discussion (Misc queries) 0 October 10th 06 11:24 PM
Copying selected rows to another sheet tacarme Excel Worksheet Functions 3 June 25th 05 11:46 AM


All times are GMT +1. The time now is 11:54 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"