Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
I made a mistake and had to delete the sheet from my xls. Can I
import the sheet from a backup? Not the data - the whole sheet with colours and formating as well.. Is that possible? Thanks - Kirk |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
Hi Kirk,
Try something like: '============= Public Sub Tester002() Dim WB1 As Workbook Dim WB2 As Workbook Dim SH As Worksheet Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub '<<============= --- Regards, Norman "kirkm" wrote in message ... I made a mistake and had to delete the sheet from my xls. Can I import the sheet from a backup? Not the data - the whole sheet with colours and formating as well.. Is that possible? Thanks - Kirk |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
On Tue, 3 Oct 2006 09:34:36 +0100, "Norman Jones"
wrote: Hi Kirk, Try something like: '============= Public Sub Tester002() Dim WB1 As Workbook Dim WB2 As Workbook Dim SH As Worksheet Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub '<<============= Hi Norman I keep getting 'subscript out of range'. Where should that code go - in a new .xls or the one I want to import to? I presume the xxx.xls string includes the full path ? (Although I tried with and without). Thanks - Kirk |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
Hi Kirk,
I keep getting 'subscript out of range'. On which line? The message indicates that the relevant workbook or sheet name is not found. This may be the result o a typing error or an inadvertently added/deleted trailing space etc. --- Regards, Norman "kirkm" wrote in message ... On Tue, 3 Oct 2006 09:34:36 +0100, "Norman Jones" wrote: Hi Kirk, Try something like: '============= Public Sub Tester002() Dim WB1 As Workbook Dim WB2 As Workbook Dim SH As Worksheet Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub '<<============= Hi Norman I keep getting 'subscript out of range'. Where should that code go - in a new .xls or the one I want to import to? I presume the xxx.xls string includes the full path ? (Although I tried with and without). Thanks - Kirk |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
Hi Norman.
Obviously, it's all your fault. <grin You held Kirks hand only three times out of four. <snip Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub The addition of "Change" here ... SH.Copy Befo=WB2.Sheets(3) '<<==== CHANGE ... and all may be well in his two sheet Workbook. (Yes, Kirk, I'm a sarcastic son of a spreadsheet, but you know I mean well) :-) Cheers, DriverDB "Norman Jones" wrote in : Hi Kirk, I keep getting 'subscript out of range'. On which line? The message indicates that the relevant workbook or sheet name is not found. This may be the result o a typing error or an inadvertently added/deleted trailing space etc. --- Regards, Norman "kirkm" wrote in message ... On Tue, 3 Oct 2006 09:34:36 +0100, "Norman Jones" wrote: Hi Kirk, Try something like: '============= Public Sub Tester002() Dim WB1 As Workbook Dim WB2 As Workbook Dim SH As Worksheet Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub '<<============= Hi Norman I keep getting 'subscript out of range'. Where should that code go - in a new .xls or the one I want to import to? I presume the xxx.xls string includes the full path ? (Although I tried with and without). Thanks - Kirk |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
Hi Driver,
The addition of "Change" here ... SH.Copy Befo=WB2.Sheets(3) '<<==== CHANGE ... and all may be well in his two sheet Workbook. Your hunch may very well be correct - especially as Kirk's needs derive from the deletion of a worksheet. However, a response ro the question: On which line? would be enlightening! --- Regards, Norman "DriverDB" <DriverDB@home wrote in message .. . Hi Norman. Obviously, it's all your fault. <grin You held Kirks hand only three times out of four. <snip Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub The addition of "Change" here ... SH.Copy Befo=WB2.Sheets(3) '<<==== CHANGE ... and all may be well in his two sheet Workbook. (Yes, Kirk, I'm a sarcastic son of a spreadsheet, but you know I mean well) :-) Cheers, DriverDB "Norman Jones" wrote in : Hi Kirk, I keep getting 'subscript out of range'. On which line? The message indicates that the relevant workbook or sheet name is not found. This may be the result o a typing error or an inadvertently added/deleted trailing space etc. --- Regards, Norman "kirkm" wrote in message ... On Tue, 3 Oct 2006 09:34:36 +0100, "Norman Jones" wrote: Hi Kirk, Try something like: '============= Public Sub Tester002() Dim WB1 As Workbook Dim WB2 As Workbook Dim SH As Worksheet Set WB1 = Workbooks("Backup.xls") '<<==== CHANGE Set WB2 = Workbooks("YourBook.xls") '<<==== CHANGE Set SH = WB1.Sheets("MASTER") '<<==== CHANGE SH.Copy Befo=WB2.Sheets(3) End Sub '<<============= Hi Norman I keep getting 'subscript out of range'. Where should that code go - in a new .xls or the one I want to import to? I presume the xxx.xls string includes the full path ? (Although I tried with and without). Thanks - Kirk |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
Kirk,
If you haven't saved the workbook and if you haven't made many other changes since the deletion then you may be able to "undo" the deletion. Go to the Edit menu and click the undo menu item until the worksheet reappears. You might be in luck. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "kirkm" wrote in message I made a mistake and had to delete the sheet from my xls. Can I import the sheet from a backup? Not the data - the whole sheet with colours and formating as well.. Is that possible? Thanks - Kirk |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import Worksheet
On Tue, 3 Oct 2006 01:37:51 -0700, "Jim Cone"
wrote: Thanks Jim but I'd saved and mucked about too much. Cheers - Kirk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import data from another Worksheet | Excel Discussion (Misc queries) | |||
Import many workbooks into one worksheet | Excel Worksheet Functions | |||
How do I Import worksheet into a word doc.? | Excel Worksheet Functions | |||
How do I import an XLT worksheet into another workbook? | Excel Programming | |||
Import from one excel worksheet into another | Excel Programming |