Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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_" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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" skrev i en meddelelse
...
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_" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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_" wrote in message
...
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" skrev i en meddelelse
...
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_" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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" skrev i en meddelelse
...
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
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
how to copy only values and formats of worksheets to new workbook rvd Excel Worksheet Functions 3 January 31st 07 12:43 PM
Copy Cells formats to another workbook koala[_18_] Excel Programming 1 November 15th 04 12:33 PM
Copy worksheet values and formats into another workbook Rick_Wendt Excel Programming 1 October 20th 04 08:14 PM
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"