Loop row selection copy with blank spaces

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • RE: Unique values from list of many values (with duplicates)
    ... blanks in the range I specifice ... Sub EFG() ... the IO_Grp list since the first cell in the range has a value. ... Dim N2 As Long ...
    (microsoft.public.excel.programming)
  • RE: Unique values from list of many values (with duplicates)
    ... the blanks from the source column; then I could use the advanced filter ... but it left blanks in between unique values. ... coupled with VBA code to get rid of the blanks. ... Dim N2 As Long ...
    (microsoft.public.excel.programming)
  • Re: Help writting a macro
    ... suppose the blanks in a particular column(it does not matter if the other ... > Public Sub DeleteBlankRows() ... > Dim C As Range ... > Set Rng = ActiveSheet.UsedRange.Rows ...
    (microsoft.public.excel.programming)
  • Re: Transposing selected column headings
    ... > additional blanks. ... >> Sub Reformat() ... >> Dim cLastRow As Long ... >> Amount are additional column headers. ...
    (microsoft.public.excel.programming)
  • Re: Variable Printing Procedure
    ... Assume column C can be used to determine the extent of printing (the last ... Dim rng as Range, rng1 as Range, rng2 as Range ... some variable blanks before a new value appears in Column B and then I ... Dim cell As Range ...
    (microsoft.public.excel.programming)