Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 23
Default copying to new workbook

thanks to other posters on this site i now have a great bit of code that moves rows to other sheets for me based on the critera in column A. The code is below but i now need to expan on it a little by havign it look for data that says "cleared" in column A and moving it to an entirely new workbook in another folder. As if that isn't hard enough it only needs to copy across columns B, C and D, then delete the row its copied.
So basically if the user types 'cleared' in column A of row 10, then the code will open the workbook "cleared data" in folder "\\my path\cleared data.xls"
it will copy across the details in cells B10, C10 and D10, close the cleared data workbook, then delete the entire row 10 in the workbook i have open.
For most of you out there i guess this is fairly easy so i would appreciate any help you can give please. Heres my code:


'\\ Now find any Scottish them to their own sheets

Set sh2 = Sheets("Scotland")
finalrow = Cells(Rows.Count, 1).End(xlUp).Row

For i = finalrow To 1 Step -1
If UCase(Left(Cells(i, 1), 2)) = "SC" Then
Rows(i).Copy sh2.Cells(sh2.Rows.Count, 1).End(xlUp)(2)
Rows(i).Delete
End If
Next i

' ** here it would then look for "CL" or "Cleared" and copy B:D to new workbook.



thank you.
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 workbook formating to a differnent workbook Roger Excel Worksheet Functions 0 October 30th 09 05:27 PM
copying worksheets to a new workbook without formulae referencing original workbook [email protected] Excel Programming 2 October 16th 06 07:31 PM
Copying data from workbook/sheets to another workbook/sheet yukon_phil Excel Programming 0 July 26th 06 07:33 PM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM


All times are GMT +1. The time now is 10:46 AM.

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

About Us

"It's about Microsoft Excel"