Results 1 to 42 of 42

Exporting

Threaded View

  1. #21
    Registered User
    Join Date
    12-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Exporting

    ok...I need a cleaner way for this to work.
    I have an idea but i am not sure how to implement it.
    this code creates the sheet in it own workbook but not the range i want or with the delimiter based on the "y" vs "n". (i have tried the active cell highlighting and still end up with a reprduction of the entire page)

    Sub Save()
        Dim myRange As String
        myRange = Selection.Address
        
        With Selection
            .Copy
            .PasteSpecial xlValues
            .PasteSpecial xlFormats
        End With
        Application.CutCopyMode = False
        ActiveWorkbook.SaveAs ActiveSheet.Name & Format(Date, "yyyymmdd")
    End Sub
    this code creates the data i want in the same workbook and the range i am looking for based on the "y" vs "n"

    Public Sub jabryantiii()
    
    Sheets.Add After:=Sheets("Sheet1")
    ActiveSheet.Name = "NewSheetName" 'Your wanted sheet name here.
    For i = 4 To 34
        If Sheets("Sheet1").Cells(i, 6).Value = "y" Then
            For j = 1 To 3
                ActiveSheet.Cells(i, j).Value = Sheets("Sheet1").Cells(i, j).Value
            Next j
            ActiveSheet.Cells(i, 6).Value = Sheets("Sheet1").Cells(i, 6).Value
            For k = 9 To 17
                ActiveSheet.Cells(i, k).Value = Sheets("Sheet1").Cells(i, k).Value
            Next k
        End If
    Next i
    
    End Sub
    So some how i need to combine the above code(s) into one to not only grab just the data i want based on the "y" vs "n" but i also need to to be created outside of the original workbook.

    is it possible to set the created data to a specific cell on the new page, so that when i code the button to Feb, Mar, Apr, Jun....that they are all displayed on the top of the workbook?
    Last edited by jabryantiii; 01-08-2010 at 02:10 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1