LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Issue Copying Data from one workbook to another

I have a macro that selects a range of cells, A1:S21000, and copies data to a
new workbook, which is then saved as a .txt file. Is there a way to select
the range and only copy cells that have true values (not formulas)?

The source sheet contains formulas from row 1 to row 21000 to accommodate
for potential data input. In most cases, however, there will be many empty
rows. As my code is now, the entire range is copied to the new sheet,
including blank rows. Is there any way to easily eliminate these blank rows
from either the copied range before paste or from the destination sheet?

Incidentally, I tried selecting all of the blank rows from my destination
sheet, then delete-entire row. Immediately after, I hit ctrl+end and the
active cell still shows as S21000. What gives?

Any help would be greatly appreciated.
Mike


CODE:
Sub CMO_Export()
Range("A5:AA209").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=True, Transpose:=False
Columns("AA:AA").Select
Application.CutCopyMode = False
Selection.NumberFormat = "yyyy-mm-dd"
Range("A5:AA209").Cells
..SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub

 
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 data validation to another workbook billf Excel Discussion (Misc queries) 3 March 14th 10 07:19 PM
issue copying data Sj Excel Discussion (Misc queries) 2 August 16th 09 03:12 PM
Color formatting issue when copying excel sheet from workbook to o Sanjeev Excel Discussion (Misc queries) 1 July 23rd 08 08:44 PM
Copying data from one workbook to another Amber T New Users to Excel 1 June 19th 08 06:53 PM
copying data from one workbook to another seawren Excel Discussion (Misc queries) 2 February 16th 05 11:55 PM


All times are GMT +1. The time now is 08:27 PM.

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"