+ Reply to Thread
Results 1 to 5 of 5

Copy range and formats to new Workbook

Hybrid View

  1. #1
    ole_
    Guest

    Copy range and formats to new Workbook

    Hi,

    does any one now how copy range A1:T33 to a new workbook with all it's
    format
    ColumnWidth, Rowheight and colours etc.
    It should be run from a commandbutton

    AHA
    Ole_



  2. #2
    Tom Ogilvy
    Guest

    Re: Copy range and formats to new Workbook

    The easiest way (in my opinion, of course) would be to copy the sheet and
    clear the unwanted data

    Private Sub CommandButton1_Click()
    Me.copy
    activesheet.Range("34:65536").EntireRow.Delete
    activesheet.Range("V:IV").EntireColumn.Delete
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs "C:\MyFolder\Newfile.xls"
    Application.DisplayAlerts = True
    End Sub

    --
    Regards,
    Tom Ogilvy



    "ole_" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > does any one now how copy range A1:T33 to a new workbook with all it's
    > format
    > ColumnWidth, Rowheight and colours etc.
    > It should be run from a commandbutton
    >
    > AHA
    > Ole_
    >
    >




  3. #3
    ole_
    Guest

    Re: Copy range and formats to new Workbook

    Yes, but my problem is that there is 13 comamandbuttons and some other code
    that i dont want to be
    transfered to the new woorkbook.

    "Tom Ogilvy" <[email protected]> skrev i en meddelelse
    news:#[email protected]...
    > The easiest way (in my opinion, of course) would be to copy the sheet and
    > clear the unwanted data
    >
    > Private Sub CommandButton1_Click()
    > Me.copy
    > activesheet.Range("34:65536").EntireRow.Delete
    > activesheet.Range("V:IV").EntireColumn.Delete
    > Application.DisplayAlerts = False
    > ActiveWorkbook.SaveAs "C:\MyFolder\Newfile.xls"
    > Application.DisplayAlerts = True
    > End Sub
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "ole_" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > >
    > > does any one now how copy range A1:T33 to a new workbook with all it's
    > > format
    > > ColumnWidth, Rowheight and colours etc.
    > > It should be run from a commandbutton
    > >
    > > AHA
    > > Ole_
    > >
    > >

    >
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: Copy range and formats to new Workbook

    Private Sub CommandButton1_Click()
    Workbooks.Add
    Application.Activeworkbook.Worksheets(1).Name = "Other"
    With Application.ActiveWorkbook.Worksheets("Other")
    me.cells.copy Destination:=.Range("A1")

    .Range("34:65536").EntireRow.Delete
    .Range("V:IV").EntireColumn.Delete
    Application.DisplayAlerts = False
    .Parent.SaveAs "C:\MyFolder\Newfile.xls"
    Application.DisplayAlerts = True
    End With
    End Sub

    --
    Regards,
    Tom Ogilvy

    "ole_" <[email protected]> wrote in message
    news:%[email protected]...
    > Yes, but my problem is that there is 13 comamandbuttons and some other

    code
    > that i dont want to be
    > transfered to the new woorkbook.
    >
    > "Tom Ogilvy" <[email protected]> skrev i en meddelelse
    > news:#[email protected]...
    > > The easiest way (in my opinion, of course) would be to copy the sheet

    and
    > > clear the unwanted data
    > >
    > > Private Sub CommandButton1_Click()
    > > Me.copy
    > > activesheet.Range("34:65536").EntireRow.Delete
    > > activesheet.Range("V:IV").EntireColumn.Delete
    > > Application.DisplayAlerts = False
    > > ActiveWorkbook.SaveAs "C:\MyFolder\Newfile.xls"
    > > Application.DisplayAlerts = True
    > > End Sub
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > >
    > > "ole_" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi,
    > > >
    > > > does any one now how copy range A1:T33 to a new workbook with all it's
    > > > format
    > > > ColumnWidth, Rowheight and colours etc.
    > > > It should be run from a commandbutton
    > > >
    > > > AHA
    > > > Ole_
    > > >
    > > >

    > >
    > >

    >
    >




  5. #5
    ole_
    Guest

    Re: Copy range and formats to new Workbook

    Hi,

    How do i modify this code below to copy 4 different sheets in same workbook
    to "C:\MyFolder\Newfile.xls"
    all with the same criteries.

    AHA.
    Ole

    "Tom Ogilvy" <[email protected]> skrev i en meddelelse
    news:#[email protected]...
    > Private Sub CommandButton1_Click()
    > Workbooks.Add
    > Application.Activeworkbook.Worksheets(1).Name = "Other"
    > With Application.ActiveWorkbook.Worksheets("Other")
    > me.cells.copy Destination:=.Range("A1")
    >
    > .Range("34:65536").EntireRow.Delete
    > .Range("V:IV").EntireColumn.Delete
    > Application.DisplayAlerts = False
    > .Parent.SaveAs "C:\MyFolder\Newfile.xls"
    > Application.DisplayAlerts = True
    > End With
    > End Sub
    >
    > --
    > Regards,
    > Tom Ogilvy




+ Reply to Thread

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