VBA Help

A

Adam1 Chicago

I'm having trouble with the ALL CAPS section of the following code (clearly
I'm a VBA novice). Any help is appreciated:

Selection.copy
WORKBOOKS (FILENAME1).SHEETS("CURRENT LONG").RANGE("A4").SELECT
WORKBOOKS (FILENAME1).SHEETS("CURRENT LONG").ACTIVESHEET.PASTE
WORKBOOKS (FILENAME1).SHEETS("CURRENT LONG").APPLICATION.CUTCOPYMODE = FALSE

I don't make it past the second line -- it doesn't seem to like the 'select'
command. I previously defined FILENAME1 in my code and it is being
recognized.

Thanks
 
E

Earl Kiosterud

Adam,

I don't see a Select in any of your lines. But in the second all-cap line,
you have SHEETS("CURRENT LONG").ACTIVESHEET. It should be one or the other.
 
D

Dana DeLouis

Sometimes Excel won't select anything if it is in another workbook, or it is
not the active sheet. Perhaps something like this.

With Application
.Goto Workbooks(FILENAME1).Sheets("CURRENT LONG").Range("A4")
ActiveSheet.Paste
.CutCopyMode = False
End With

It's easier to read if it's not in all Caps
HTH
Dana DeLouis
 
Top