Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub cmdGet_Click()
If Not FileExists("S:\MHE Monitor\subcon.xls") Then MsgBox "The file doesn't exist!" Else Workbooks.Open "S:\MHE Monitor\subcon.xls" Sheets("Sheet1").Select With Activesheet .Cells(1, 1).Select .Range(.Range("A1"), _ ActiveCell.SpecialCells(xlLastCell)).Copy End With Workbooks("Subcon Out.xls").Activate ActiveSheet.Cells(1, 3).Select 'Selection.Paste 'Workbooks("subcon.xls").Close SaveChanges:=False End If End Sub -- Regards, Tom Ogilvy "gti_jobert" wrote in message ... Cheers bob, I will do as you suggested! A quick question though - I have a cmdButton on a sheet and am trying to select a range but it keep coming up with an error "Method 'Range' of Object '_Worksheet' Failed". I have the following code; Code: -------------------- Private Sub cmdGet_Click() If Not FileExists("S:\MHE Monitor\subcon.xls") Then MsgBox "The file doesn't exist!" Else Workbooks.Open "S:\MHE Monitor\subcon.xls" Sheets("Sheet1").Select ActiveSheet.Cells(1, 1).Select *Range(Range("A1"), ActiveCell.SpecialCells(xlLastCell)).Copy* Workbooks("Subcon Out.xls").Activate ActiveSheet.Cells(1, 3).Select 'Selection.Paste 'Workbooks("subcon.xls").Close SaveChanges:=False End If End Sub -------------------- -- gti_jobert ------------------------------------------------------------------------ gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634 View this thread: http://www.excelforum.com/showthread...hreadid=518700 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting used cells only in the workbook | Excel Discussion (Misc queries) | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
Selecting a worksheet in a workbook | Excel Programming | |||
Selecting workbook | Excel Programming | |||
Help!!!! Selecting a cell in another workbook | Excel Programming |