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: 8
Default Loop row selection copy with blank spaces

The code I have loops through a column of dates that have blank spaces
between different dates. For each date the rows between the blanks are
copied and saved as a seperate .csv file. This works fine if there a
two or more of the same date between the blanks. If there is only one
row for one date between the blanks it will copy that row, yet, not
continue to the next date, and the macro stops?

I have a modest clue of what I'm doing?
Any Help would be appreciated.

TIA

''///cell A1 is blank and selected to start

Do While IsEmpty(ActiveCell.Offset(1, 0)) = False

Dim i As Integer
i = ActiveCell.Row + 1
Do Until IsEmpty(Cells(i, 1).Value)
i = i + 1
Loop
Range(Cells(ActiveCell.Row + 1, 1), Cells(i - 1, 25)).Select


Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False


Range("A1").Select
x = Cells(1, 1).Value
ActiveWorkbook.SaveAs Filename:= _
"C:\" & x & ".csv", FileFormat _
:=xlCSV, CreateBackup:=False

ActiveWindow.Close

ActiveCell.End(xlDown).Offset(1, 0).Select

Loop



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
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
ranking with some blank spaces LRR via OfficeKB.com Excel Worksheet Functions 7 April 16th 06 03:04 PM
How to create blank spaces denileigh[_4_] Excel Programming 3 January 18th 06 09:32 PM
Blank spaces Scurloc Excel Discussion (Misc queries) 4 December 22nd 05 05:08 PM
Copy value and fill blank spaces below it until new value is encountered? drod[_2_] Excel Programming 4 January 8th 04 08:22 PM


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