View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
steve steve is offline
external usenet poster
 
Posts: 576
Default Working with a WK1 format...

Randy,

If it works its great.

But you can make it better.

Learn to eliminate "Select", makes the code simpler and faster
And unless you did a copy somewhere before this, don't know why you need
Application.CutCopyMode = False
Use it after the paste.

Sheets("Lode").Select
Range("A1:D3500").Select
Application.CutCopyMode = False
Selection.ClearContents

Might be replaced with
Sheets("Lode").Range("A1:D3500").ClearContents

And you can copy and paste real easy
Workbooks("wb1").Sheets("Sheet1").Range("A1:D3500" ).Copy _
Destination:=Workbooks("wb2").Sheets("Sheet1").Ran ge("A1")
(make your substitutes for wb1, wb2, Sheet1)
If its in the same workbook than you don't need to have the Workbooks part.

steve

"Randy Schwanke" wrote in message
...
Thank you,

In the mean time I came up with this, it's very crude, but appears to
work...

Sub First()
Sheets("Lode").Select
Range("A1:D3500").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A1").Select
Sheets("Cougar").Select
Application.Dialogs(xlDialogOpen).Show arg1:="H:\US Cable\*.WK1"

Range("A1:D3500").Select
Selection.Copy
Application.ActiveWindow.Close "YES"
SENDKEYS "{Enter}", False
ActiveWindow.ActivatePrevious

Sheets("Lode").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
Sheets("Cougar").Select
Range("A1").Select

ActiveWindow.ActivatePrevious
Application.CutCopyMode = False
'ActiveWorkbook.Close
ActiveWindow.WindowState = xlMaximized

End Sub



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!